diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2022-04-27 23:07:04 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-28 00:06:44 +0000 |
commit | db67c16a6445e66ff85a5f4d800b6b9393e82cdd (patch) | |
tree | bba40dab6baa4c44d312d841753e973000334405 | |
parent | df26f908c50bd2efaa48c2d9dade971f165674dd (diff) | |
download | mongo-db67c16a6445e66ff85a5f4d800b6b9393e82cdd.tar.gz |
SERVER-66009 Avoid use of mongo process interface if search is in an update pipeline
-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; |