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

findAndModify regression 2.0.x -> v2.2.0rc0 with positional updates

    • 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
    • None
    • ALL

      Exepected result: modify the document
      Actual result: error.

      > db.foo.find()
      { "_id" : ObjectId("5010009b54f3e488821117fc"), "j" : 0, "s" : "abc", "e" : [ { "t" : "a", "c" : 100 } ] }
      > db.runCommand( { findAndModify: "foo", query : { s : "abc", j : 0 , 'e.t' : "a" }, update : { $set : { 'e.$.c' : 3 } }  });
      {
              "value" : {
                      "_id" : ObjectId("5010009b54f3e488821117fc"),
                      "j" : 0,
                      "s" : "abc",
                      "e" : [
                              {
                                      "t" : "a",
                                      "c" : 100
                              }
                      ]
              },
              "errmsg" : "exception: can't append to array using string field name [$]",
              "code" : 13048,
              "ok" : 0
      }
      

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            richard.kreuter Richard Kreuter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: