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

insert command does not move _id field to the front of BSON obj

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: 2.5.3
    • Component/s: None
    • None
    • ALL

      > db.user.insert({ x: 1, _id: 2 })
      > db.user.find()
      { "_id" : 2, "x" : 1 }
      > db.user.drop()
      true
      > db.runCommand({ insert: 'user', documents: [{ x: 1, _id: 2 }]})
      { "ok" : 1, "n" : 1 }
      > db.user.find()
      { "x" : 1, "_id" : 2 }
      

      Not sure if moving _id field to the front is the desired behavior, but eval8.js fails if we switch to using write commands because of this.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: