[SERVER-12353] Error message of failed $mul operation mentions $inc Created: 13/Jan/14  Updated: 11/Jul/16  Resolved: 14/Jan/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.5.2
Fix Version/s: 2.5.5

Type: Bug Priority: Minor - P4
Reporter: Matt Kangas Assignee: Matt Kangas
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-12350 Failed update with $mul errors with r... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The following message should say "Cannot apply $mul ..." rather than "$inc"

$mul was introduced in 2.5.2.

> db.foo.save({_id:1, a:"one", b:2, c:3})
> db.foo.update({_id:1}, {$mul: {a: 2.25}})
> db.getLastError()
Cannot apply $inc to a value of non-numeric type. {_id: 1.0} has the field 'a' of non-numeric type String



 Comments   
Comment by Matt Kangas [ 14/Jan/14 ]

For test case, now returns:

Cannot apply $mul to a value of non-numeric type. {_id: 1.0} has the field 'a' of non-numeric type String

Comment by Githook User [ 14/Jan/14 ]

Author:

{u'username': u'comerford', u'name': u'Adam Comerford', u'email': u'adam@comerford.cc'}

Message: 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>
Branch: master
https://github.com/mongodb/mongo/commit/cec1b16a90acadf97b892a56fb15943a72f04398

Generated at Thu Feb 08 03:28:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.