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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.2.0-rc0
    • 2.2.0-rc1
    • Querying
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: