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

XMLWordPrintableJSON

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

      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
              Reporter:
              Remon van Vliet
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: