diff options
author | David Percy <david.percy@mongodb.com> | 2020-12-01 21:56:14 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-27 17:27:53 +0000 |
commit | 1cbf4fff902fbc1f62563877ce0bb02bcadfa68d (patch) | |
tree | 12ce758e39016f0e972872684d157d5c89a0e850 /src/mongo/db/pipeline/document_source.cpp | |
parent | ac99b5cf6202e2941220a1f5f56b8223af1841e9 (diff) | |
download | mongo-1cbf4fff902fbc1f62563877ce0bb02bcadfa68d.tar.gz |
SERVER-53397 Desugar $setWindowFields partitionBy using $sort
Diffstat (limited to 'src/mongo/db/pipeline/document_source.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document_source.cpp b/src/mongo/db/pipeline/document_source.cpp index d33581db906..aa0ca4885ea 100644 --- a/src/mongo/db/pipeline/document_source.cpp +++ b/src/mongo/db/pipeline/document_source.cpp @@ -79,7 +79,19 @@ void DocumentSource::registerParser( it == parserMap.end()); parserMap[name] = {parser, requiredMinVersion}; } +void DocumentSource::registerParser( + string name, + SimpleParser simpleParser, + boost::optional<ServerGlobalParams::FeatureCompatibility::Version> requiredMinVersion) { + Parser parser = + [simpleParser = std::move(simpleParser)]( + BSONElement stageSpec, + const intrusive_ptr<ExpressionContext>& expCtx) -> list<intrusive_ptr<DocumentSource>> { + return {simpleParser(std::move(stageSpec), expCtx)}; + }; + return registerParser(std::move(name), std::move(parser), std::move(requiredMinVersion)); +} bool DocumentSource::hasQuery() const { return false; } |