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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 2.0.0, 2.0.1
    • Fix Version/s: None
    • Component/s: Write Ops
    • Environment:
      All
    • Operating System:
      ALL

      Description

      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?

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: