summaryrefslogtreecommitdiff
path: root/src/mongo/bson/util/bson_extract.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/bson/util/bson_extract.cpp')
-rw-r--r--src/mongo/bson/util/bson_extract.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/mongo/bson/util/bson_extract.cpp b/src/mongo/bson/util/bson_extract.cpp
index acd52ce7d82..4335d1c3699 100644
--- a/src/mongo/bson/util/bson_extract.cpp
+++ b/src/mongo/bson/util/bson_extract.cpp
@@ -65,10 +65,9 @@ Status bsonExtractTypedFieldImpl(const BSONObj& object,
return status;
if (type != outElement->type()) {
return Status(ErrorCodes::TypeMismatch,
- str::stream() << "\"" << fieldName << "\" had the wrong type. Expected "
- << typeName(type)
- << ", found "
- << typeName(outElement->type()));
+ str::stream()
+ << "\"" << fieldName << "\" had the wrong type. Expected "
+ << typeName(type) << ", found " << typeName(outElement->type()));
}
return status;
}
@@ -83,9 +82,9 @@ Status bsonExtractIntegerFieldImpl(const BSONObj& object,
return status;
if (!element.isNumber()) {
return Status(ErrorCodes::TypeMismatch,
- str::stream() << "Expected field \"" << fieldName
- << "\" to have numeric type, but found "
- << typeName(element.type()));
+ str::stream()
+ << "Expected field \"" << fieldName
+ << "\" to have numeric type, but found " << typeName(element.type()));
}
long long result = element.safeNumberLong();
if (result != element.numberDouble()) {
@@ -109,9 +108,9 @@ Status bsonExtractDoubleFieldImpl(const BSONObj& object,
return status;
if (!element.isNumber()) {
return Status(ErrorCodes::TypeMismatch,
- str::stream() << "Expected field \"" << fieldName
- << "\" to have numeric type, but found "
- << typeName(element.type()));
+ str::stream()
+ << "Expected field \"" << fieldName
+ << "\" to have numeric type, but found " << typeName(element.type()));
}
*out = element.numberDouble();
return status;
@@ -155,8 +154,7 @@ Status bsonExtractBooleanFieldWithDefault(const BSONObj& object,
if (!element.isNumber() && !element.isBoolean()) {
return Status(ErrorCodes::TypeMismatch,
str::stream() << "Expected boolean or number type for field \"" << fieldName
- << "\", found "
- << typeName(element.type()));
+ << "\", found " << typeName(element.type()));
}
*out = element.trueValue();
return status;
@@ -261,8 +259,7 @@ Status bsonExtractIntegerFieldWithDefaultIf(const BSONObj& object,
if (!pred(*out)) {
return Status(ErrorCodes::BadValue,
str::stream() << "Invalid value in field \"" << fieldName << "\": " << *out
- << ": "
- << predDescription);
+ << ": " << predDescription);
}
return status;
}