Update returns with no error but no data changed

24 views
Skip to first unread message

Jeremy Wilson

unread,
Jun 13, 2012, 6:03:11 PM6/13/12
to mongod...@googlegroups.com
We have a very strange problem. Our production system returns successful for a write operation:

Jun 13 17:57:19 app3 php-fpm: pool www: UserModel::blockUser(XZZbaab) - query: {"_id":"jaaaaab"} update: {"$addToSet":{"blkusr":"XZZbaab"}}
Jun 13 17:57:19 app3 php-fpm: pool www: UserModel::blockUser(XZZbaab) - result: {"singleShard":"db1\/db1.prod.keek.com:27017,db1r1.la.keek.com:27017,db1r1.mi.keek.com:27017,db1r1.prod.keek.com:27017,db1r1.uk.keek.com:27017,db1r2.prod.keek.com:27017,db1r3.prod.keek.com:27017","updatedExisting":true,"n":1,"lastOp":5.7536440134208e+18,"connectionId":141826,"err":null,"ok":1}

But the record doesn't get updated:

PRIMARY> db.users.find({"_id": "jaaaaab"}).pretty()
{
"_id" : "jaaaaab",
"active" : 1,
"avtr" : {
"ext" : "jpg",
"dir" : "69/eb/69ebab6c3f7b8c798947ac444a91891b",
"ts" : 1335113576
},
"blkusr" : [ ],

This works fine in our staging environment but not production. Both are running sharded on 2.0.6.

Adam C

unread,
Jun 14, 2012, 8:51:06 AM6/14/12
to mongod...@googlegroups.com
What happens if you run the update from the mongo shell (on production) instead of via PHP?

> db.user.update({"_id":"jaaaaab"}, {$addToSet:{"blkusr":"XZZbaab"}})

Adam.
Reply all
Reply to author
Forward
0 new messages