summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/update_node.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2017-06-05 14:22:26 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2017-06-14 13:07:13 -0400
commit676206d10e8a626e9c5e39045468dbe0bb2bd75a (patch)
treeb58e3870549031f651473582af72ff164a05c51b /src/mongo/db/update/update_node.cpp
parent023c34f624656d53ae1f6b015998f3fc035cb1eb (diff)
downloadmongo-676206d10e8a626e9c5e39045468dbe0bb2bd75a.tar.gz
SERVER-28763 Create UpdateArrayNode
Diffstat (limited to 'src/mongo/db/update/update_node.cpp')
-rw-r--r--src/mongo/db/update/update_node.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/update/update_node.cpp b/src/mongo/db/update/update_node.cpp
index ed96fa84741..043fb52c489 100644
--- a/src/mongo/db/update/update_node.cpp
+++ b/src/mongo/db/update/update_node.cpp
@@ -31,6 +31,7 @@
#include "mongo/db/update/update_node.h"
#include "mongo/base/status_with.h"
+#include "mongo/db/update/update_array_node.h"
#include "mongo/db/update/update_object_node.h"
namespace mongo {
@@ -44,6 +45,12 @@ std::unique_ptr<UpdateNode> UpdateNode::createUpdateNodeByMerging(const UpdateNo
static_cast<const UpdateObjectNode&>(leftNode),
static_cast<const UpdateObjectNode&>(rightNode),
pathTaken);
+ } else if (leftNode.type == UpdateNode::Type::Array &&
+ rightNode.type == UpdateNode::Type::Array) {
+ return UpdateArrayNode::createUpdateNodeByMerging(
+ static_cast<const UpdateArrayNode&>(leftNode),
+ static_cast<const UpdateArrayNode&>(rightNode),
+ pathTaken);
} else {
uasserted(
ErrorCodes::ConflictingUpdateOperators,