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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.5.3
    • Fix Version/s: 2.5.5
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      > 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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eliot Eliot Horowitz (Inactive)
              Reporter:
              renctan Randolph Tan
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: