summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/update_object_node.cpp
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:20:35 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-27 11:02:23 -0400
commit134a4083953270e8a11430395357fb70a29047ad (patch)
treedd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /src/mongo/db/update/update_object_node.cpp
parent1e46b5049003f427047e723ea5fab15b5a9253ca (diff)
downloadmongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'src/mongo/db/update/update_object_node.cpp')
-rw-r--r--src/mongo/db/update/update_object_node.cpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/mongo/db/update/update_object_node.cpp b/src/mongo/db/update/update_object_node.cpp
index 6298b8389c5..27863d15ee1 100644
--- a/src/mongo/db/update/update_object_node.cpp
+++ b/src/mongo/db/update/update_object_node.cpp
@@ -62,8 +62,7 @@ StatusWith<std::string> parseArrayFilterIdentifier(
return Status(ErrorCodes::BadValue,
str::stream() << "Cannot have array filter identifier (i.e. '$[<id>]') "
"element in the first position in path '"
- << fieldRef.dottedField()
- << "'");
+ << fieldRef.dottedField() << "'");
}
auto identifier = field.substr(2, field.size() - 3);
@@ -71,9 +70,7 @@ StatusWith<std::string> parseArrayFilterIdentifier(
if (!identifier.empty() && arrayFilters.find(identifier) == arrayFilters.end()) {
return Status(ErrorCodes::BadValue,
str::stream() << "No array filter found for identifier '" << identifier
- << "' in path '"
- << fieldRef.dottedField()
- << "'");
+ << "' in path '" << fieldRef.dottedField() << "'");
}
if (!identifier.empty()) {
@@ -190,7 +187,7 @@ void applyChild(const UpdateNode& child,
BSONObj makeBSONForOperator(const std::vector<std::pair<std::string, BSONObj>>& updatesForOp) {
BSONObjBuilder bob;
- for (const auto & [ path, value ] : updatesForOp)
+ for (const auto& [path, value] : updatesForOp)
bob << path << value.firstElement();
return bob.obj();
}
@@ -228,8 +225,8 @@ StatusWith<bool> UpdateObjectNode::parseAndMerge(
// be a string value.
if (BSONType::String != modExpr.type()) {
return Status(ErrorCodes::BadValue,
- str::stream() << "The 'to' field for $rename must be a string: "
- << modExpr);
+ str::stream()
+ << "The 'to' field for $rename must be a string: " << modExpr);
}
fieldRef.parse(modExpr.valueStringData());
@@ -250,8 +247,7 @@ StatusWith<bool> UpdateObjectNode::parseAndMerge(
if (positional && positionalCount > 1) {
return Status(ErrorCodes::BadValue,
str::stream() << "Too many positional (i.e. '$') elements found in path '"
- << fieldRef.dottedField()
- << "'");
+ << fieldRef.dottedField() << "'");
}
if (positional && positionalIndex == 0) {
@@ -259,8 +255,7 @@ StatusWith<bool> UpdateObjectNode::parseAndMerge(
ErrorCodes::BadValue,
str::stream()
<< "Cannot have positional (i.e. '$') element in the first position in path '"
- << fieldRef.dottedField()
- << "'");
+ << fieldRef.dottedField() << "'");
}
// Construct and initialize the leaf node.
@@ -298,8 +293,7 @@ StatusWith<bool> UpdateObjectNode::parseAndMerge(
return Status(ErrorCodes::ConflictingUpdateOperators,
str::stream() << "Updating the path '" << fieldRef.dottedField()
<< "' would create a conflict at '"
- << fieldRef.dottedSubstring(0, i + 1)
- << "'");
+ << fieldRef.dottedSubstring(0, i + 1) << "'");
}
} else {
std::unique_ptr<UpdateInternalNode> ownedChild;
@@ -335,10 +329,9 @@ StatusWith<bool> UpdateObjectNode::parseAndMerge(
if (current->getChild(childName)) {
return Status(ErrorCodes::ConflictingUpdateOperators,
- str::stream() << "Updating the path '" << fieldRef.dottedField()
- << "' would create a conflict at '"
- << fieldRef.dottedField()
- << "'");
+ str::stream()
+ << "Updating the path '" << fieldRef.dottedField()
+ << "' would create a conflict at '" << fieldRef.dottedField() << "'");
}
current->setChild(std::move(childName), std::move(leaf));
@@ -389,12 +382,12 @@ BSONObj UpdateObjectNode::serialize() const {
BSONObjBuilder bob;
- for (const auto & [ pathPrefix, child ] : _children) {
+ for (const auto& [pathPrefix, child] : _children) {
auto path = FieldRef(pathPrefix);
child->produceSerializationMap(&path, &operatorOrientedUpdates);
}
- for (const auto & [ op, updates ] : operatorOrientedUpdates)
+ for (const auto& [op, updates] : operatorOrientedUpdates)
bob << op << makeBSONForOperator(updates);
return bob.obj();