diff options
-rw-r--r-- | src/mongo/db/ops/parsed_update.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/pipeline/expression_context.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/ops/parsed_update.cpp b/src/mongo/db/ops/parsed_update.cpp index ac281c89101..b9557e4b2fe 100644 --- a/src/mongo/db/ops/parsed_update.cpp +++ b/src/mongo/db/ops/parsed_update.cpp @@ -193,11 +193,12 @@ void ParsedUpdate::parseUpdate() { source == OperationSource::kTimeseriesUpdate) { _driver.setSkipDotsDollarsCheck(true); } - + _expCtx->isParsingPipelineUpdate = true; _driver.parse(_request->getUpdateModification(), _arrayFilters, _request->getUpdateConstants(), _request->isMulti()); + _expCtx->isParsingPipelineUpdate = false; } PlanYieldPolicy::YieldPolicy ParsedUpdate::yieldPolicy() const { diff --git a/src/mongo/db/pipeline/expression_context.h b/src/mongo/db/pipeline/expression_context.h index 784e6d22175..3e33cc5b6bf 100644 --- a/src/mongo/db/pipeline/expression_context.h +++ b/src/mongo/db/pipeline/expression_context.h @@ -442,6 +442,9 @@ public: // True if this ExpressionContext is used to parse a view definition pipeline. bool isParsingViewDefinition = false; + // True if this ExpressionContext is being used to parse an update pipeline. + bool isParsingPipelineUpdate = false; + // True if this ExpressionContext is used to parse a collection validator expression. bool isParsingCollectionValidator = false; |