diff options
Diffstat (limited to 'src/mongo/db/update/update_driver.cpp')
-rw-r--r-- | src/mongo/db/update/update_driver.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/mongo/db/update/update_driver.cpp b/src/mongo/db/update/update_driver.cpp index b094dcef6f9..8402971f9af 100644 --- a/src/mongo/db/update/update_driver.cpp +++ b/src/mongo/db/update/update_driver.cpp @@ -289,27 +289,21 @@ Status UpdateDriver::update(StringData matchedField, if (_root) { // We parsed using the new UpdateNode implementation. - FieldRef pathToCreate; - FieldRef pathTaken; - bool indexesAffected = false; - bool noop = false; - _root->apply(doc->root(), - &pathToCreate, - &pathTaken, - matchedField, - _modOptions.fromReplication, - validateForStorage, - immutablePaths, - _indexedFields, - (_logOp && logOpRec) ? &logBuilder : nullptr, - &indexesAffected, - &noop); - if (indexesAffected) { + UpdateNode::ApplyParams applyParams(doc->root(), immutablePaths); + applyParams.matchedField = matchedField; + applyParams.fromReplication = _modOptions.fromReplication; + applyParams.validateForStorage = validateForStorage; + applyParams.indexData = _indexedFields; + if (_logOp && logOpRec) { + applyParams.logBuilder = &logBuilder; + } + auto applyResult = _root->apply(applyParams); + if (applyResult.indexesAffected) { _affectIndices = true; doc->disableInPlaceUpdates(); } if (docWasModified) { - *docWasModified = !noop; + *docWasModified = !applyResult.noop; } } else { |