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

error message "can't append to array using string field name" on indexed list updates

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.2
    • Affects Version/s: 1.4.0, 1.4.1
    • Component/s: Write Ops
    • Labels:
      None
    • Environment:
      Windows 7, 64bit (1.4.1), (and Linux MongoDB v1.4.0 as reported by other user)

      as discussed on http://groups.google.com/group/mongodb-user/browse_thread/thread/c5b67a50b814ce46#

      When I try to update a value in an indexed list I get the error:
      "can't append to array using string field name"

      As soon as I remove the index, the update performs with no problems.

      I have some test documents like this:

      {"cast":["Samuel","John"],"movie":"Pulp Fiction"} {"cast":["John","Hugh","Halle"],"movie":"Swordfish"}

      "cast" has an ascending index.

      My update routine in PHP looks like this:
      $collection->update(
      array('cast' => 'John'),
      array('$set' => array('cast.$' => 'John Travolta')),
      array('multiple' => TRUE)
      );

      I've tried the same on the console, same result: with index I get the error,
      without the index the update works.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            doublesteve Steffen Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: