Update was a no-op but reported a change

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.8.0
    • Component/s: Write Ops
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      > db.b.findOne()
      {
      "_id" : ObjectId("4d9785a5e8cf7bf87ef7a681"),
      "groups" : [

      { "groupId" : ObjectId("4d9733172eda11cf36199d6b"), "addTime" : ISODate("2011-04-02T20:28:46.442Z") }

      ,

      { "groupId" : ObjectId("4d9733172eda11cf36199d6c"), "addTime" : ISODate("2011-04-02T20:28:46.442Z") }

      ]
      }
      // I made a mistake here when it should have included "groups" like this: { $pull : { groups : { groupId....
      > db.b.update({_id:ObjectId("4d9785a5e8cf7bf87ef7a681")}, {$pull: { groupId:new ObjectId("4d9733172eda11cf36199d6b")}})
      > db.getLastErrorObj()
      {
      "updatedExisting" : true,
      "n" : 1,
      "connectionId" : 16,
      "err" : null,
      "ok" : 1
      }
      //doesn't look updated to me.
      > db.b.findOne()
      {
      "_id" : ObjectId("4d9785a5e8cf7bf87ef7a681"),
      "groups" : [

      { "groupId" : ObjectId("4d9733172eda11cf36199d6b"), "addTime" : ISODate("2011-04-02T20:28:46.442Z") }

      ,

      { "groupId" : ObjectId("4d9733172eda11cf36199d6c"), "addTime" : ISODate("2011-04-02T20:28:46.442Z") }

      ]
      }

              Assignee:
              Unassigned
              Reporter:
              Scott Hernandez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: