diff options
Diffstat (limited to 'src/mongo/db/pipeline/document_source.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source.cpp | 6 |
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); } |