diff options
Diffstat (limited to 'src/mongo/db/pipeline/document_source_index_stats.h')
-rw-r--r-- | src/mongo/db/pipeline/document_source_index_stats.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document_source_index_stats.h b/src/mongo/db/pipeline/document_source_index_stats.h index e802e0d7016..7d25aca6c9f 100644 --- a/src/mongo/db/pipeline/document_source_index_stats.h +++ b/src/mongo/db/pipeline/document_source_index_stats.h @@ -39,6 +39,31 @@ namespace mongo { */ class DocumentSourceIndexStats final : public DocumentSourceNeedsMongod { public: + class LiteParsed final : public LiteParsedDocumentSource { + public: + static std::unique_ptr<LiteParsed> parse(const AggregationRequest& request, + const BSONElement& spec) { + return stdx::make_unique<LiteParsed>(request.getNamespaceString()); + } + + explicit LiteParsed(NamespaceString nss) : _nss(std::move(nss)) {} + + stdx::unordered_set<NamespaceString> getInvolvedNamespaces() const final { + return stdx::unordered_set<NamespaceString>(); + } + + PrivilegeVector requiredPrivileges(bool isMongos) const final { + return {Privilege(ResourcePattern::forExactNamespace(_nss), ActionType::indexStats)}; + } + + bool isInitialSource() const final { + return true; + } + + private: + const NamespaceString _nss; + }; + // virtuals from DocumentSource GetNextResult getNext() final; const char* getSourceName() const final; |