summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source.cpp
diff options
context:
space:
mode:
authorDavid Percy <david.percy@mongodb.com>2020-12-01 21:56:14 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-27 17:27:53 +0000
commit1cbf4fff902fbc1f62563877ce0bb02bcadfa68d (patch)
tree12ce758e39016f0e972872684d157d5c89a0e850 /src/mongo/db/pipeline/document_source.cpp
parentac99b5cf6202e2941220a1f5f56b8223af1841e9 (diff)
downloadmongo-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.cpp12
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;
}