> db.foo.drop() true > db.foo.update({'a.b':1, 'a.c':1}, {$inc:{z:1}}, true) // Works > db.foo.find() { "_id" : ObjectId("4f286edcf2d87b48ed83cb08"), "a" : { "b" : 1, "c" : 1 }, "z" : 1 } > db.foo.update({'a':{b:1}, 'a.c':1}, {$inc:{z:1}}, true) // Boom! > db.foo.find() { "_id" : ObjectId("4f286edcf2d87b48ed83cb08"), "a" : { "b" : 1, "c" : 1 }, "z" : 1 } { "_id" : ObjectId("4f286efef2d87b48ed83cb09"), "a" : { "b" : 1 }, "a" : { "b" : 1 }, "z" : 1 }
The last one is actually
{a: {b:1}, a: {c:1}}
, but printjson function doesn't handle duplicate field names correctly (not sure if it is possible from JS).
- is depended on by
-
SERVER-6835 Sharding edge case upserts documents with multiple _id attributes
- Closed
- is duplicated by
-
SERVER-11514 segfault on upsert with conflicting fields in the query document
- Closed
-
SERVER-11363 Update call causes mongod to crash
- Closed
- related to
-
SERVER-75879 Upsert permits document to contain multiple _id fields
- Closed