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

findandmodify doesn't set fields properly for getlasterror

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.0-rc1
    • Affects Version/s: 2.2.0-rc0
    • Component/s: Querying
    • Labels:
      None
    • ALL

      > 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
      }
      

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

              Created:
              Updated:
              Resolved: