Description
Reproduce with this (ops must be applied in order):
|
|
db.test.insert({'name': 'TEST'})
|
db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test.one': 1}}, new:true})
|
db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test..foo': 1}}, new:true})
|
db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test.two': 1}}, new:true})
|
The second findAndModify statement creates an embedded doc under a blank key ("").
The subsequent call to findAndModify in the last line, even when executed multiple times, never seems to actually increment the counter.