summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/modifier_node.h
diff options
context:
space:
mode:
authorIan Boros <ian.boros@mongodb.com>2020-07-16 17:08:50 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-27 16:22:12 +0000
commitff04007db36d1e1a80aff009b00518e068ed074b (patch)
tree252498a4b3263ef8f02feee705ffc73ea9d4d721 /src/mongo/db/update/modifier_node.h
parentd3fedc03bb3b2037bc4f2266b4cd106377c217b7 (diff)
downloadmongo-ff04007db36d1e1a80aff009b00518e068ed074b.tar.gz
SERVER-50274 Refactor update system LogBuilder interface
Diffstat (limited to 'src/mongo/db/update/modifier_node.h')
-rw-r--r--src/mongo/db/update/modifier_node.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/db/update/modifier_node.h b/src/mongo/db/update/modifier_node.h
index 4c26735400d..d9063768151 100644
--- a/src/mongo/db/update/modifier_node.h
+++ b/src/mongo/db/update/modifier_node.h
@@ -84,7 +84,7 @@ protected:
* what kind of update was performed in its return value.
*/
virtual ModifyResult updateExistingElement(mutablebson::Element* element,
- std::shared_ptr<FieldRef> elementPath) const = 0;
+ const FieldRef& elementPath) const = 0;
/**
* ModifierNode::apply() calls this method when applying an update to a path that does not yet
@@ -135,11 +135,15 @@ protected:
* setValueForNewElement().
* - 'modifyResult' is either the value returned by updateExistingElement() or the value
* ModifyResult::kCreated.
+ * - 'createdFieldIdx' indicates what the first component in 'pathTaken' is that was created as
+ * part of this update. If the update did not add any new fields, boost::none should be
+ * provided.
*/
- virtual void logUpdate(LogBuilder* logBuilder,
- StringData pathTaken,
+ virtual void logUpdate(LogBuilderInterface* logBuilder,
+ const RuntimeUpdatePath& pathTaken,
mutablebson::Element element,
- ModifyResult modifyResult) const;
+ ModifyResult modifyResult,
+ boost::optional<int> createdFieldIdx) const;
/**
* ModifierNode::apply() calls this method to determine what to do when applying an update to a