diff options
Diffstat (limited to 'src/mongo/db/ops/modifier_inc.cpp')
-rw-r--r-- | src/mongo/db/ops/modifier_inc.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/mongo/db/ops/modifier_inc.cpp b/src/mongo/db/ops/modifier_inc.cpp index 8bc6e2ff9a4..314ac6a5024 100644 --- a/src/mongo/db/ops/modifier_inc.cpp +++ b/src/mongo/db/ops/modifier_inc.cpp @@ -89,7 +89,8 @@ Status ModifierInc::init(const BSONElement& modExpr, const Options& opts, bool* if (foundDollar && foundCount > 1) { return Status(ErrorCodes::BadValue, str::stream() << "Too many positional (i.e. '$') elements found in path '" - << _fieldRef.dottedField() << "'"); + << _fieldRef.dottedField() + << "'"); } // @@ -101,7 +102,9 @@ Status ModifierInc::init(const BSONElement& modExpr, const Options& opts, bool* // include mod code, etc. return Status(ErrorCodes::TypeMismatch, str::stream() << "Cannot " << (_mode == MODE_INC ? "increment" : "multiply") - << " with non-numeric argument: {" << modExpr << "}"); + << " with non-numeric argument: {" + << modExpr + << "}"); } _val = modExpr; @@ -172,7 +175,8 @@ Status ModifierInc::prepare(mutablebson::Element root, mb::Element idElem = mb::findFirstChildNamed(root, "_id"); return Status(ErrorCodes::TypeMismatch, str::stream() << "Cannot apply " << (_mode == MODE_INC ? "$inc" : "$mul") - << " to a value of non-numeric type. {" << idElem.toString() + << " to a value of non-numeric type. {" + << idElem.toString() << "} has the field '" << _preparedState->elemFound.getFieldName() << "' of non-numeric type " @@ -191,8 +195,10 @@ Status ModifierInc::prepare(mutablebson::Element root, mb::Element idElem = mb::findFirstChildNamed(root, "_id"); return Status(ErrorCodes::BadValue, str::stream() << "Failed to apply $inc operations to current value (" - << currentValue.debugString() << ") for document {" - << idElem.toString() << "}"); + << currentValue.debugString() + << ") for document {" + << idElem.toString() + << "}"); } // If the values are identical (same type, same value), then this is a no-op. @@ -254,8 +260,11 @@ Status ModifierInc::log(LogBuilder* logBuilder) const { if (!logElement.ok()) { return Status(ErrorCodes::InternalError, str::stream() << "Could not append entry to " - << (_mode == MODE_INC ? "$inc" : "$mul") << " oplog entry: " - << "set '" << _fieldRef.dottedField() << "' -> " + << (_mode == MODE_INC ? "$inc" : "$mul") + << " oplog entry: " + << "set '" + << _fieldRef.dottedField() + << "' -> " << _preparedState->newValue.debugString()); } |