summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/parsed_aggregation_projection.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/pipeline/parsed_aggregation_projection.cpp
parent1e46b5049003f427047e723ea5fab15b5a9253ca (diff)
downloadmongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'src/mongo/db/pipeline/parsed_aggregation_projection.cpp')
-rw-r--r--src/mongo/db/pipeline/parsed_aggregation_projection.cpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/mongo/db/pipeline/parsed_aggregation_projection.cpp b/src/mongo/db/pipeline/parsed_aggregation_projection.cpp
index 058e20b6d0b..75e0a95cd5d 100644
--- a/src/mongo/db/pipeline/parsed_aggregation_projection.cpp
+++ b/src/mongo/db/pipeline/parsed_aggregation_projection.cpp
@@ -81,11 +81,7 @@ void ProjectionSpecValidator::ensurePathDoesNotConflictOrThrow(const std::string
uassert(40176,
str::stream() << "specification contains two conflicting paths. "
"Cannot specify both '"
- << path
- << "' and '"
- << *conflictingPath
- << "': "
- << _rawObj.toString(),
+ << path << "' and '" << *conflictingPath << "': " << _rawObj.toString(),
!conflictingPath);
}
@@ -124,10 +120,8 @@ void ProjectionSpecValidator::parseNestedObject(const BSONObj& thisLevelSpec,
uasserted(40181,
str::stream() << "an expression specification must contain exactly "
"one field, the name of the expression. Found "
- << thisLevelSpec.nFields()
- << " fields in "
- << thisLevelSpec.toString()
- << ", while parsing object "
+ << thisLevelSpec.nFields() << " fields in "
+ << thisLevelSpec.toString() << ", while parsing object "
<< _rawObj.toString());
}
ensurePathDoesNotConflictOrThrow(prefix.fullPath());
@@ -136,8 +130,7 @@ void ProjectionSpecValidator::parseNestedObject(const BSONObj& thisLevelSpec,
if (fieldName.find('.') != std::string::npos) {
uasserted(40183,
str::stream() << "cannot use dotted field name '" << fieldName
- << "' in a sub object: "
- << _rawObj.toString());
+ << "' in a sub object: " << _rawObj.toString());
}
parseElement(elem, FieldPath::getFullyQualifiedPath(prefix.fullPath(), fieldName));
}
@@ -240,23 +233,25 @@ private:
} else if ((elem.isBoolean() || elem.isNumber()) && !elem.trueValue()) {
// If this is an excluded field other than '_id', ensure that the projection type has
// not already been set to kInclusionProjection.
- uassert(40178,
- str::stream() << "Bad projection specification, cannot exclude fields "
- "other than '_id' in an inclusion projection: "
- << _rawObj.toString(),
- !_parsedType || (*_parsedType ==
- TransformerInterface::TransformerType::kExclusionProjection));
+ uassert(
+ 40178,
+ str::stream() << "Bad projection specification, cannot exclude fields "
+ "other than '_id' in an inclusion projection: "
+ << _rawObj.toString(),
+ !_parsedType ||
+ (*_parsedType == TransformerInterface::TransformerType::kExclusionProjection));
_parsedType = TransformerInterface::TransformerType::kExclusionProjection;
} else {
// A boolean true, a truthy numeric value, or any expression can only be used with an
// inclusion projection. Note that literal values like "string" or null are also treated
// as expressions.
- uassert(40179,
- str::stream() << "Bad projection specification, cannot include fields or "
- "add computed fields during an exclusion projection: "
- << _rawObj.toString(),
- !_parsedType || (*_parsedType ==
- TransformerInterface::TransformerType::kInclusionProjection));
+ uassert(
+ 40179,
+ str::stream() << "Bad projection specification, cannot include fields or "
+ "add computed fields during an exclusion projection: "
+ << _rawObj.toString(),
+ !_parsedType ||
+ (*_parsedType == TransformerInterface::TransformerType::kInclusionProjection));
_parsedType = TransformerInterface::TransformerType::kInclusionProjection;
}
}