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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.2.0-rc0
    • Fix Version/s: 2.2.0-rc1
    • Component/s: Write Ops
    • Labels:
    • Environment:
      All
    • Backwards Compatibility:
      Major Change
    • Operating System:
      ALL

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: