summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/update_node.h
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2017-06-27 13:06:18 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2017-06-30 17:10:38 -0400
commit07baac065147381842a172726a5f80d7e57a6ef8 (patch)
treef358a00798025d4b848ddb5231ccd2974e3db501 /src/mongo/db/update/update_node.h
parentacc6b704793fc37d5439b32b64a186a500436a36 (diff)
downloadmongo-07baac065147381842a172726a5f80d7e57a6ef8.tar.gz
SERVER-29162 UpdateNode implementation should only validate modified fields
Diffstat (limited to 'src/mongo/db/update/update_node.h')
-rw-r--r--src/mongo/db/update/update_node.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/update/update_node.h b/src/mongo/db/update/update_node.h
index f134c6272e8..a9e093008a3 100644
--- a/src/mongo/db/update/update_node.h
+++ b/src/mongo/db/update/update_node.h
@@ -32,7 +32,7 @@
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/mutable/element.h"
-#include "mongo/db/field_ref.h"
+#include "mongo/db/field_ref_set.h"
#include "mongo/db/update/log_builder.h"
#include "mongo/db/update_index_data.h"
#include "mongo/util/assert_util.h"
@@ -87,13 +87,17 @@ public:
* when the update is from replication. Uses the index information in 'indexData' to determine
* whether indexes are affected. If a LogBuilder is provided, logs the update. Outputs whether
* the operation was a no-op. Trips a uassert (which throws UserException) if the update node
- * cannot be applied to the document.
+ * cannot be applied to the document. If 'validateForStorage' is true, ensures that modified
+ * elements do not violate depth or DBRef constraints. Ensures that no paths in 'immutablePaths'
+ * are modified (though they may be created, if they do not yet exist).
*/
virtual void apply(mutablebson::Element element,
FieldRef* pathToCreate,
FieldRef* pathTaken,
StringData matchedField,
bool fromReplication,
+ bool validateForStorage,
+ const FieldRefSet& immutablePaths,
const UpdateIndexData* indexData,
LogBuilder* logBuilder,
bool* indexesAffected,