Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15589

Do not allow creating inserted doc from update with dotted _id path sources

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 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}
      

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: