summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/lite_parsed_pipeline.h
diff options
context:
space:
mode:
authorgalon1 <gil.alon@mongodb.com>2022-09-20 20:57:33 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-20 22:51:06 +0000
commit4f0c417801b6aa0e478675220975d6dc92d45233 (patch)
tree40f19613f920c9e817996ed024265213379ddc90 /src/mongo/db/pipeline/lite_parsed_pipeline.h
parent631a1b711803941cdab5d2b11d544eae5e9ed63a (diff)
downloadmongo-4f0c417801b6aa0e478675220975d6dc92d45233.tar.gz
SERVER-63811 Add check to allow documents stage to run without a database existing
Diffstat (limited to 'src/mongo/db/pipeline/lite_parsed_pipeline.h')
-rw-r--r--src/mongo/db/pipeline/lite_parsed_pipeline.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/lite_parsed_pipeline.h b/src/mongo/db/pipeline/lite_parsed_pipeline.h
index 712d23c32bd..d02ff8ee70e 100644
--- a/src/mongo/db/pipeline/lite_parsed_pipeline.h
+++ b/src/mongo/db/pipeline/lite_parsed_pipeline.h
@@ -123,6 +123,13 @@ public:
}
/**
+ * Returns true if the pipeline begins with a $documents stage.
+ */
+ bool startsWithDocuments() const {
+ return !_stageSpecs.empty() && _stageSpecs.front()->isDocuments();
+ }
+
+ /**
* Returns true if the pipeline has a $changeStream stage.
*/
bool hasChangeStream() const {