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

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

    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

      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
      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: