summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_graph_lookup.h
diff options
context:
space:
mode:
authorArun Banala <arun.banala@mongodb.com>2020-01-27 17:14:37 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-01-29 00:23:05 +0000
commitfe52d534b34f180077ab26bb22e140cb2750497b (patch)
treeb291fa831d0a3a78612dbe19da31b4b6e8bb339b /src/mongo/db/pipeline/document_source_graph_lookup.h
parent681631228dbaa98e00d1ea6d98c00662ef293a2b (diff)
downloadmongo-fe52d534b34f180077ab26bb22e140cb2750497b.tar.gz
SERVER-45590 Allow building a LiteParsedPipeline without first building an AggregationRequest
Diffstat (limited to 'src/mongo/db/pipeline/document_source_graph_lookup.h')
-rw-r--r--src/mongo/db/pipeline/document_source_graph_lookup.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mongo/db/pipeline/document_source_graph_lookup.h b/src/mongo/db/pipeline/document_source_graph_lookup.h
index 77512232c36..85afcb9cf69 100644
--- a/src/mongo/db/pipeline/document_source_graph_lookup.h
+++ b/src/mongo/db/pipeline/document_source_graph_lookup.h
@@ -41,18 +41,23 @@ class DocumentSourceGraphLookUp final : public DocumentSource {
public:
static constexpr StringData kStageName = "$graphLookup"_sd;
- class LiteParsed : public LiteParsedDocumentSourceForeignCollections {
+ class LiteParsed : public LiteParsedDocumentSourceForeignCollection {
public:
- LiteParsed(NamespaceString foreignNss, PrivilegeVector privileges)
- : LiteParsedDocumentSourceForeignCollections(std::move(foreignNss),
- std::move(privileges)) {}
+ LiteParsed(NamespaceString foreignNss)
+ : LiteParsedDocumentSourceForeignCollection(std::move(foreignNss)) {}
+
+ static std::unique_ptr<LiteParsed> parse(const NamespaceString& nss,
+ const BSONElement& spec);
+
bool allowShardedForeignCollection(NamespaceString nss) const override {
- return (_foreignNssSet.find(nss) == _foreignNssSet.end());
+ return _foreignNss != nss;
+ }
+
+ PrivilegeVector requiredPrivileges(bool isMongos, bool bypassDocumentValidation) const {
+ return {Privilege(ResourcePattern::forExactNamespace(_foreignNss), ActionType::find)};
}
};
- static std::unique_ptr<LiteParsed> liteParse(const AggregationRequest& request,
- const BSONElement& spec);
const char* getSourceName() const final;