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

Upsert with filters for a subdocument and a nested subdocument key result with an invalid BSON. (one document with two duplicate keys!)

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.2, 2.4.3
    • Component/s: Write Ops
    • None
    • Environment:
      OS X
    • ALL

      Have a look at the resulting document, the 'key' subdocument repeats twice!:

      test> db.test.update({'key':

      {'nested': 1}

      , 'key.nested': 2}, {$set: {a:3}},

      {upsert:true}

      )
      test> db.test.find()
      {
      "_id": ObjectId("518b90225fef1b6560f579c3"),
      "a": 3,
      "key":

      { "nested": 1 }

      ,
      "key":

      { "nested": 1 }

      }

            Assignee:
            Unassigned Unassigned
            Reporter:
            alonho Alon Horev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: