diff options
author | Ian Boros <ian.boros@mongodb.com> | 2019-11-12 23:31:43 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-11-12 23:31:43 +0000 |
commit | 05f45f9a3f3deb4e5d1e3e1f2ab1e4a2b80e959e (patch) | |
tree | dce18cff88d6d541432a940987bbede056eb6d57 /src/mongo/db/pipeline/pipeline_d.cpp | |
parent | 812524322f9f947ca2198366f9802b8befe3274d (diff) | |
download | mongo-05f45f9a3f3deb4e5d1e3e1f2ab1e4a2b80e959e.tar.gz |
SERVER-44321 treat $meta-only projections depending on context
Diffstat (limited to 'src/mongo/db/pipeline/pipeline_d.cpp')
-rw-r--r-- | src/mongo/db/pipeline/pipeline_d.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 049758ff8b3..a20a8382e4a 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -100,7 +100,6 @@ using std::unique_ptr; using write_ops::Insert; namespace { - /** * Return whether the given sort spec can be used in a find() sort. */ @@ -219,8 +218,12 @@ StatusWith<std::unique_ptr<PlanExecutor, PlanExecutor::Deleter>> attemptToGetExe const ExtensionsCallbackReal extensionsCallback(expCtx->opCtx, &nss); - auto cq = CanonicalQuery::canonicalize( - expCtx->opCtx, std::move(qr), expCtx, extensionsCallback, matcherFeatures); + auto cq = CanonicalQuery::canonicalize(expCtx->opCtx, + std::move(qr), + expCtx, + extensionsCallback, + matcherFeatures, + ProjectionPolicies::aggregateProjectionPolicies()); if (!cq.isOK()) { // Return an error instead of uasserting, since there are cases where the combination of |