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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Write Ops
    • None
    • Query
    • Fully Compatible

    Description

      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}
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: