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

Upserts featuring $in and related operator criteria result in inconsistent behaviour depending on nesting level

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.0, 2.0.1
    • Component/s: Write Ops
    • Environment:
      All
    • ALL

      Upserts with $in clause results in either the operator being added to the document or it being ignored depending on nesting depth :

      > db.test.update({a:{$in:[1]}}, {$set:{v:1}}, true, false)
      > db.test.find()

      { "_id" : ObjectId("4ecd047da0627e0c2e464b5e"), "v" : 1 }

      > db.test.update({a:{b:{$in:[1]}}}, {$set:{v:1}}, true, false)
      > db.test.find()
      { "_id" : ObjectId("4ecd0487a0627e0c2e464b5f"), "a" : { "b" :

      { "$in" : [ 1 ] }

      }, "v" : 1 }

      Is this intended? And if not which one is the correct behaviour?

            Assignee:
            Unassigned Unassigned
            Reporter:
            remonvv Remon van Vliet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: