-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Write Ops
-
None
-
Query
-
Fully Compatible
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
For the following update (which results in an insert) this should not be allowed because it produces a document without constant _id field ordering:
db.a.update({"_id.a":1, "_id.b":2}, {$inc:{x:1}}, {upsert:true}) db.a.find() {_id:{a:1, b:2}, x:1} db.a.remove({}) db.a.update({"_id.b":1}, {$inc:{x:1}, $setOnInsert:{"_id.a":2}}, {upsert:true}) db.a.find() {_id:{b:1,a:2}, x:1}