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

upserts handle operators (i.e. $exists) in a manner inconsistent with inserts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.2.2, 2.4.11, 2.6.3
    • 2.6.4
    • Write Ops
    • None
    • Debian
    • ALL
    • Hide

      shape:PRIMARY> db.foo.update({_id: {year: 2012, url: {$exists: false}}}, {$inc: {bar: 1}}, {upsert: true})
       
      shape:PRIMARY> db.foo.find()
      { "_id" : { "year" : 2012, "url" : { "$exists" : false } }, "bar" : 1 }

      Show
      shape:PRIMARY> db.foo.update({_id: {year: 2012, url: {$exists: false}}}, {$inc: {bar: 1}}, {upsert: true})   shape:PRIMARY> db.foo.find() { "_id" : { "year" : 2012, "url" : { "$exists" : false } }, "bar" : 1 }

    Description

      During an upsert inserting a document, {$exists: false} can be inserted in the collection.

      Attachments

        Issue Links

          Activity

            People

              ramon.fernandez@mongodb.com Ramon Fernandez Marina
              root Julien
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: