summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/pipeline.cpp')
-rw-r--r--src/mongo/db/pipeline/pipeline.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp
index d92a6fa3b29..97a896e5898 100644
--- a/src/mongo/db/pipeline/pipeline.cpp
+++ b/src/mongo/db/pipeline/pipeline.cpp
@@ -153,12 +153,13 @@ Pipeline::~Pipeline() {
invariant(_disposed);
}
-std::unique_ptr<Pipeline, PipelineDeleter> Pipeline::clone() const {
+std::unique_ptr<Pipeline, PipelineDeleter> Pipeline::clone(
+ const boost::intrusive_ptr<ExpressionContext>& newExpCtx) const {
SourceContainer clonedStages;
for (auto&& stage : _sources) {
- clonedStages.push_back(stage->clone());
+ clonedStages.push_back(stage->clone(newExpCtx));
}
- return create(clonedStages, getContext());
+ return create(clonedStages, newExpCtx ? newExpCtx : getContext());
}
template <class T>