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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.2, 2.5.0
    • Component/s: JavaScript
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: