summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/stage_constraints.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/stage_constraints.h')
-rw-r--r--src/mongo/db/pipeline/stage_constraints.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/stage_constraints.h b/src/mongo/db/pipeline/stage_constraints.h
index e955039feb2..17537069d51 100644
--- a/src/mongo/db/pipeline/stage_constraints.h
+++ b/src/mongo/db/pipeline/stage_constraints.h
@@ -343,6 +343,10 @@ struct StageConstraints {
// Indicates that a stage is allowed within a pipeline-stlye update.
bool isAllowedWithinUpdatePipeline = false;
+ // Indicates that a stage does not modify anything to do with a sort and can be done before a
+ // following merge sort.
+ bool preservesOrderAndMetadata = false;
+
bool operator==(const StageConstraints& other) const {
return requiredPosition == other.requiredPosition &&
hostRequirement == other.hostRequirement && diskRequirement == other.diskRequirement &&
@@ -355,7 +359,8 @@ struct StageConstraints {
canSwapWithMatch == other.canSwapWithMatch &&
canSwapWithSkippingOrLimitingStage == other.canSwapWithSkippingOrLimitingStage &&
isAllowedWithinUpdatePipeline == other.isAllowedWithinUpdatePipeline &&
- unionRequirement == other.unionRequirement;
+ unionRequirement == other.unionRequirement &&
+ preservesOrderAndMetadata == other.preservesOrderAndMetadata;
}
};
} // namespace mongo