summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/update.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2017-07-31 16:56:39 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2017-08-02 16:17:20 -0400
commitf38554ab9fd611bb798812e4eb1fa7e3d3bbb7e3 (patch)
tree78c6942f857158d205a71bebde9f95b373848975 /src/mongo/db/exec/update.cpp
parent5f1ce8b6765a25d45ba5e35063db417b3069c8d6 (diff)
downloadmongo-f38554ab9fd611bb798812e4eb1fa7e3d3bbb7e3.tar.gz
SERVER-28773 Create insert mode for SetNode
Diffstat (limited to 'src/mongo/db/exec/update.cpp')
-rw-r--r--src/mongo/db/exec/update.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/db/exec/update.cpp b/src/mongo/db/exec/update.cpp
index 7e8c279c7d1..7533a0b2680 100644
--- a/src/mongo/db/exec/update.cpp
+++ b/src/mongo/db/exec/update.cpp
@@ -165,8 +165,6 @@ UpdateStage::UpdateStage(OperationContext* opCtx,
_updatedRecordIds(params.request->isMulti() ? new RecordIdSet() : NULL),
_doc(params.driver->getDocument()) {
_children.emplace_back(child);
- // We are an update until we fall into the insert case.
- params.driver->setContext(ModifierInterface::ExecInfo::UPDATE_CONTEXT);
// Before we even start executing, we know whether or not this is a replacement
// style or $mod style update.
@@ -378,7 +376,7 @@ Status UpdateStage::applyUpdateOpsForInsert(OperationContext* opCtx,
// oplog record, then. We also set the context of the update driver to the INSERT_CONTEXT.
// Some mods may only work in that context (e.g. $setOnInsert).
driver->setLogOp(false);
- driver->setContext(ModifierInterface::ExecInfo::INSERT_CONTEXT);
+ driver->setInsert(true);
FieldRefSet immutablePaths;
if (!isInternalRequest) {