diff options
author | Justin Seyster <justin.seyster@mongodb.com> | 2017-08-18 15:00:08 -0400 |
---|---|---|
committer | Justin Seyster <justin.seyster@mongodb.com> | 2017-08-18 19:13:27 -0400 |
commit | aef10829fc71cb41c54df5838e9e7e74d41d122b (patch) | |
tree | 23916345612945a059de6798303f2f597561a1f6 /src/mongo/db/update/set_node_test.cpp | |
parent | b3ad5d465cd2fec4983ff84be9da2cc06c1dac97 (diff) | |
download | mongo-aef10829fc71cb41c54df5838e9e7e74d41d122b.tar.gz |
SERVER-30401 Simplify UpdateLeafNode::apply interface
We need some simplifiction here because UpdateLeafNode::apply is
responsible for so many things (a list of which is in
modifier_node.h). This change puts most of those things into one
function, so that the various modifier implementations can write a few
small overrides to customize their functionality, rather than
reimplementing all of apply() in each case.
This approach extends the PathCreatingNode approach we took previously
for all the modifiers. The one exception is RenameNode, which we
implement by composing SetNode and UnsetNode.
Diffstat (limited to 'src/mongo/db/update/set_node_test.cpp')
-rw-r--r-- | src/mongo/db/update/set_node_test.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/update/set_node_test.cpp b/src/mongo/db/update/set_node_test.cpp index 792b7632c39..ec51b1b1e9c 100644 --- a/src/mongo/db/update/set_node_test.cpp +++ b/src/mongo/db/update/set_node_test.cpp @@ -1055,7 +1055,7 @@ TEST_F(SetNodeTest, ApplyCannotOverwriteImmutablePath) { node.apply(getApplyParams(doc.root()["a"]["b"])), AssertionException, ErrorCodes::ImmutableField, - "Updating the path 'a.b' to b: 1 would modify the immutable field 'a.b'"); + "Performing an update on the path 'a.b' would modify the immutable field 'a.b'"); } TEST_F(SetNodeTest, ApplyCanPerformNoopOnImmutablePath) { @@ -1179,7 +1179,7 @@ TEST_F(SetNodeTest, ApplyCannotOverwriteSuffixOfImmutablePath) { node.apply(getApplyParams(doc.root()["a"]["b"]["c"])), AssertionException, ErrorCodes::ImmutableField, - "Updating the path 'a.b.c' to c: 1 would modify the immutable field 'a.b'"); + "Performing an update on the path 'a.b.c' would modify the immutable field 'a.b'"); } TEST_F(SetNodeTest, ApplyCanPerformNoopOnSuffixOfImmutablePath) { |