[SERVER-12945] v2.6.0-rc0 update $mul uses "increment" in error messages Created: 27/Feb/14  Updated: 11/Jul/16  Resolved: 27/Feb/14

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc1

Type: Improvement Priority: Trivial - P5
Reporter: Roman Kuzmin Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-12992 Error message for $mul with non-numer... Closed
Related
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The steps:

> db.test.update({x : 1}, {$mul : {x : null}}, {upsert : true})
WriteResult({
        "nMatched" : 0,
        "nUpserted" : 0,
        "nModified" : 0,
        "writeError" : {
                "code" : 2,
                "errmsg" : "Cannot increment with non-numeric argument: {x: null}"
        }
})

The error message uses "increment". It should be "multiply".



 Comments   
Comment by Githook User [ 27/Feb/14 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-12945: inc/mul error message more better
Branch: master
https://github.com/mongodb/mongo/commit/04f7ab3acc4e10edac4e34a7a8a4bc47b1934132

Comment by Scott Hernandez (Inactive) [ 27/Feb/14 ]

This is the new behavior:

> db.a.update({}, {$mul:{x:"test"}})
...		"errmsg" : "Cannot multiply with non-numeric argument: {x: \"test\"}"
	}
})
> db.a.update({}, {$inc:{x:"test"}})
...		"errmsg" : "Cannot increment with non-numeric argument: {x: \"test\"}"
	}
})

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