summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_graph_lookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/document_source_graph_lookup.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_graph_lookup.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document_source_graph_lookup.cpp b/src/mongo/db/pipeline/document_source_graph_lookup.cpp
index 6e9c4776df4..bc055a679e3 100644
--- a/src/mongo/db/pipeline/document_source_graph_lookup.cpp
+++ b/src/mongo/db/pipeline/document_source_graph_lookup.cpp
@@ -482,6 +482,10 @@ DocumentSourceGraphLookUp::DocumentSourceGraphLookUp(
boost::none,
expCtx->getCollator() ? expCtx->getCollator()->clone() : nullptr);
+ _fromExpCtx->variables = expCtx->variables;
+ _fromExpCtx->variablesParseState =
+ expCtx->variablesParseState.copyWith(expCtx->variables.useIdGenerator());
+
// We append an additional BSONObj to '_fromPipeline' as a placeholder for the $match stage
// we'll eventually construct from the input document.
_fromPipeline = resolvedNamespace.pipeline;