summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source.cpp
diff options
context:
space:
mode:
authorSally McNichols <sally.mcnichols@mongodb.com>2016-06-16 10:38:29 -0400
committerSally McNichols <sally.mcnichols@mongodb.com>2016-06-16 10:38:29 -0400
commit069be92b4f2c35140a711cb47d88baf961d74795 (patch)
treedc1414546c5b5423023d66b227fe6dd242a65357 /src/mongo/db/pipeline/document_source.cpp
parente9cd7667471eff437463e7de842af95747847be4 (diff)
downloadmongo-069be92b4f2c35140a711cb47d88baf961d74795.tar.gz
SERVER-23816 Add $sortByCount aggregation stage
Diffstat (limited to 'src/mongo/db/pipeline/document_source.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source.cpp b/src/mongo/db/pipeline/document_source.cpp
index 33e85baa380..430e3cf1496 100644
--- a/src/mongo/db/pipeline/document_source.cpp
+++ b/src/mongo/db/pipeline/document_source.cpp
@@ -56,8 +56,8 @@ void DocumentSource::registerParser(string name, Parser parser) {
parserMap[name] = parser;
}
-intrusive_ptr<DocumentSource> DocumentSource::parse(const intrusive_ptr<ExpressionContext> expCtx,
- BSONObj stageObj) {
+vector<intrusive_ptr<DocumentSource>> DocumentSource::parse(
+ const intrusive_ptr<ExpressionContext> expCtx, BSONObj stageObj) {
uassert(16435,
"A pipeline stage specification object must contain exactly one field.",
stageObj.nFields() == 1);
@@ -66,9 +66,11 @@ intrusive_ptr<DocumentSource> DocumentSource::parse(const intrusive_ptr<Expressi
// Get the registered parser and call that.
auto it = parserMap.find(stageName);
+
uassert(16436,
str::stream() << "Unrecognized pipeline stage name: '" << stageName << "'",
it != parserMap.end());
+
return it->second(stageSpec, expCtx);
}