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

"Extra" fields added to lazy BSON V8 objects not order preserving

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.2, 2.5.0
    • Affects Version/s: None
    • Component/s: JavaScript
    • Labels:
      None
    • Fully Compatible
    • ALL

      Caused by fix for SERVER-9066 so this isn't in any released version: https://github.com/mongodb/mongo/commit/d2febea6d4a66998682467aa0e4adc0d55365166

      > db.z.drop()
      true
      > db.z.insert({})
      > obj = db.z.findOne()
      { "_id" : ObjectId("515e01d9136e8af76db54678") }
      > obj.c = 1; obj
      { "_id" : ObjectId("515e01d9136e8af76db54678"), "c" : 1 }
      > obj.b = 1; obj
      { "_id" : ObjectId("515e01d9136e8af76db54678"), "b" : 1, "c" : 1 }
      > obj.a = 1; obj
      { "_id" : ObjectId("515e01d9136e8af76db54678"), "a" : 1, "b" : 1, "c" : 1 }
      

      The last 3 fields should be in in the opposite order, that is in insertion order.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: