diff options
author | Adam Comerford <adam@comerford.cc> | 2014-01-13 16:05:58 -0500 |
---|---|---|
committer | Matt Kangas <matt.kangas@mongodb.com> | 2014-01-13 18:50:48 -0500 |
commit | cec1b16a90acadf97b892a56fb15943a72f04398 (patch) | |
tree | 1bdaf1e6c1deeab9e6bbeed409d7362630b7cb31 /src/mongo/db/ops/modifier_inc.cpp | |
parent | 4f9c0008b9c046690d9d84579ccd98b8553412ab (diff) | |
download | mongo-cec1b16a90acadf97b892a56fb15943a72f04398.tar.gz |
SERVER-12353 Fix error message of failed $mul
Checks to see the mode ($inc or $mul) of the failed update and prints out the correct one.
Previously always printed $inc regardless of mode.
Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Diffstat (limited to 'src/mongo/db/ops/modifier_inc.cpp')
-rw-r--r-- | src/mongo/db/ops/modifier_inc.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/ops/modifier_inc.cpp b/src/mongo/db/ops/modifier_inc.cpp index 7e88604e974..17c681f06a7 100644 --- a/src/mongo/db/ops/modifier_inc.cpp +++ b/src/mongo/db/ops/modifier_inc.cpp @@ -192,7 +192,9 @@ namespace mongo { mb::Element idElem = mb::findFirstChildNamed(root, "_id"); return Status( ErrorCodes::BadValue, - str::stream() << "Cannot apply $inc to a value of non-numeric type. {" + str::stream() << "Cannot apply " + << (_mode == MODE_INC ? "$inc" : "$mul") + << " to a value of non-numeric type. {" << idElem.toString() << "} has the field '" << _preparedState->elemFound.getFieldName() << "' of non-numeric type " |