summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/lite_parsed_document_source.h
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2017-06-20 12:42:00 -0400
committerJames Wahlin <james@mongodb.com>2017-06-22 12:04:47 -0400
commit04da0519f6b80bd75fb6920881b0ea211f6b277a (patch)
tree512ea2a4bc355b651986e2aa65a3cc88b4287ad2 /src/mongo/db/pipeline/lite_parsed_document_source.h
parent46f57a1e5213b0c06b54dcc65286f199155c126a (diff)
downloadmongo-04da0519f6b80bd75fb6920881b0ea211f6b277a.tar.gz
SERVER-29371 Add support for lite parse of namespace in nested $lookup
Diffstat (limited to 'src/mongo/db/pipeline/lite_parsed_document_source.h')
-rw-r--r--src/mongo/db/pipeline/lite_parsed_document_source.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mongo/db/pipeline/lite_parsed_document_source.h b/src/mongo/db/pipeline/lite_parsed_document_source.h
index da358775ab8..dae9ee222ce 100644
--- a/src/mongo/db/pipeline/lite_parsed_document_source.h
+++ b/src/mongo/db/pipeline/lite_parsed_document_source.h
@@ -119,19 +119,22 @@ public:
};
/**
- * Helper class for DocumentSources which work with exactly one foreign collection to register as
- * their lite parser.
+ * Helper class for DocumentSources which which reference one or more foreign collections.
*/
-class LiteParsedDocumentSourceOneForeignCollection : public LiteParsedDocumentSource {
+class LiteParsedDocumentSourceForeignCollections : public LiteParsedDocumentSource {
public:
- explicit LiteParsedDocumentSourceOneForeignCollection(NamespaceString foreignNss)
- : _foreignNss(std::move(foreignNss)) {}
+ explicit LiteParsedDocumentSourceForeignCollections(NamespaceString foreignNss)
+ : _foreignNssSet{std::move(foreignNss)} {}
+
+ explicit LiteParsedDocumentSourceForeignCollections(
+ stdx::unordered_set<NamespaceString> foreignNssSet)
+ : _foreignNssSet(std::move(foreignNssSet)) {}
stdx::unordered_set<NamespaceString> getInvolvedNamespaces() const final {
- return {_foreignNss};
+ return {_foreignNssSet};
}
private:
- NamespaceString _foreignNss;
+ stdx::unordered_set<NamespaceString> _foreignNssSet;
};
} // namespace mongo