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

findandmodify doesn't set fields properly for getlasterror

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-rc0
    • Fix Version/s: 2.2.0-rc1
    • Component/s: Querying
    • Labels:
      None
    • Operating System:
      ALL

      Description

      > db.foo.insert({x:1})
      > db.foo.findAndModify({query:{x : 1}, update:{$set : {date : new Date()}}})
      { "_id" : ObjectId("500f0966afa3600a3d3fdcd8"), "x" : 1 }
      >
      > // this should return {"n" : 1, ...
      > db.runCommand({getlasterror:1})
      { "n" : 0, "connectionId" : 7, "err" : null, "ok" : 1 }
      > db.foo.findOne()
      {
              "_id" : ObjectId("500f0966afa3600a3d3fdcd8"),
              "date" : ISODate("2012-07-24T20:45:28.665Z"),
              "x" : 1
      }

        Attachments

          Activity

            People

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            kristina Kristina Chodorow (Inactive)
            Participants:
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: