summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilitsa Sotirova <militsa.sotirova@mongodb.com>2023-05-03 19:12:12 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-03 19:38:49 +0000
commita1651acc96eaf979c8ecd1fb1967b8139b9b717c (patch)
tree11af335ea857c24497943e1c5dfa3f2228d39cb7
parentab68b7ddfc85e196dec31420c58752ccb870b934 (diff)
downloadmongo-a1651acc96eaf979c8ecd1fb1967b8139b9b717c.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.cpp3
-rw-r--r--src/mongo/db/pipeline/expression_context.h3
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 6b0bf316073..191328b0892 100644
--- a/src/mongo/db/ops/parsed_update.cpp
+++ b/src/mongo/db/ops/parsed_update.cpp
@@ -188,11 +188,12 @@ void ParsedUpdate::parseUpdate() {
_driver.setCollator(_expCtx->getCollator());
_driver.setLogOp(true);
_driver.setFromOplogApplication(_request->isFromOplogApplication());
-
+ _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 b1a2027652e..136992b20c2 100644
--- a/src/mongo/db/pipeline/expression_context.h
+++ b/src/mongo/db/pipeline/expression_context.h
@@ -415,6 +415,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;