[mongodb-user] Updates on indexed list not working

1 view
Skip to first unread message

Steffen S.

unread,
Apr 26, 2010, 4:42:52 PM4/26/10
to mongod...@googlegroups.com
Hi,

I'm using MongoDB 1.4.1 on Win 7 64bit with PHP.

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.

Any ideas on that one?

Thanks a lot,
Steffen

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

aaron

unread,
Apr 28, 2010, 1:58:04 PM4/28/10
to mongodb-user
Thanks for reporting this issue, Steffen. You can track our progress
on it here: <http://jira.mongodb.org/browse/SERVER-1062>.
Reply all
Reply to author
Forward
0 new messages