mongodb - Mongo record not updating, no error either -
here record want update:
{ "_id" : objectid("519177384e2e9fee10000000"), "fb_id" : { "0" : "2000" }, "name" : { "0" : "aaa bbb" }, "email" : { "0" : "abc@abc.com" } }
i fb_id changed "2000"
, instead of { "0" : "2000" }
.
i tried..
primary> db.users.update({fb_id : "{ 0 : 2000 }"},{$set: {fb_id: "2000"}});
it did not work did not through error either. doing wrong?
you need move double quotes:
db.users.update({fb_id : { "0" : "2000" }},{$set: {fb_id: "2000"}})
Comments
Post a Comment