[SERVER-12350] Failed update with $mul errors with reference to $inc Created: 13/Jan/14  Updated: 23/Feb/15  Resolved: 14/Jan/14

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.5.4
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Adam Comerford Assignee: Scott Hernandez (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-12353 Error message of failed $mul operatio... Closed
Operating System: ALL
Participants:

 Description   

Trivial to reproduce, just set a field to a string, then try to multiply it and you get the $inc error:

db.foo.update({}, {$mul : {a : 2}}, false, {multi : true}, {ordered : false})
Update WriteResult({
	"ok" : 1,
	"nDocsModified" : 0,
	"n" : 0,
	"writeErrors" : [
		{
			"index" : 0,
			"code" : 16837,
			"errmsg" : "Cannot apply $inc to a value of non-numeric type. {_id: ObjectId('52d44e8d4166d7524db9bd2d')} has the field 'a' of non-numeric type String"
		}
	]
})

Proposed fix (needs validation):

https://github.com/mongodb/mongo/pull/610



 Comments   
Comment by Scott Hernandez (Inactive) [ 14/Jan/14 ]

dup of SERVER-12353

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