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

findAndModify errors when upserting on non-existent document and original query can't find doc

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.0-rc1
    • Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.2.0-rc0
    • Component/s: Write Ops
    • Environment:
      All
    • Major Change
    • ALL

      The following findAndModify succeeds on 2.0 and lower and fails on 2.1 and higher :

      db.test.findAndModify({query:

      {f:1}

      , update:{$set:{f:2}}, upsert:true, new:true})

      With the following (somewhat vague) error : uncaught exception: findAndModifyFailed failed: "exception: assertion src\\mongo\\db\\commands
      find_and_modify.cpp:146"

      The expected behaviour would be that this operation returns

      { "_id" : ... , "f" : 2 }

      but as shown it fails.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            remonvv Remon van Vliet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: