summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/expression_context.cpp')
-rw-r--r--src/mongo/db/pipeline/expression_context.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/expression_context.cpp b/src/mongo/db/pipeline/expression_context.cpp
index 69698ab0289..86a20538afc 100644
--- a/src/mongo/db/pipeline/expression_context.cpp
+++ b/src/mongo/db/pipeline/expression_context.cpp
@@ -92,7 +92,8 @@ ExpressionContext::ExpressionContext(
StringMap<ExpressionContext::ResolvedNamespace> resolvedNamespaces,
boost::optional<UUID> collUUID,
const boost::optional<BSONObj>& letParameters,
- bool mayDbProfile)
+ bool mayDbProfile,
+ bool omitVariables)
: explain(explain),
fromMongos(fromMongos),
needsMerge(needsMerge),
@@ -127,6 +128,9 @@ ExpressionContext::ExpressionContext(
}
if (letParameters)
variables.seedVariablesWithLetParameters(this, *letParameters);
+
+ if (omitVariables)
+ variables = Variables{};
}
ExpressionContext::ExpressionContext(