summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/pipeline_d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/pipeline_d.cpp')
-rw-r--r--src/mongo/db/pipeline/pipeline_d.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp
index f1222797f11..697c639ccf7 100644
--- a/src/mongo/db/pipeline/pipeline_d.cpp
+++ b/src/mongo/db/pipeline/pipeline_d.cpp
@@ -454,7 +454,8 @@ void PipelineD::prepareCursorSource(Collection* collection,
}
}
- if (!sources.empty() && !sources.front()->constraints().requiresInputDocSource) {
+ // If the first stage of the pipeline is an initial source, we don't need an input cursor.
+ if (!sources.empty() && sources.front()->isInitialSource()) {
return;
}