Let's assume we have the following record
> db.users.findOne() { "_id" : ObjectId("4e2f0a99a26037e417000056"), "info" : { "Qu" : { "start" : "1320021626", "stop" : 1320779121 }, "Se" : { "start" : 1320021628, "stop" : 1320779121 }, "Se I" : { "start" : "1320021629", "stop" : 1320779121 }, "Se I_Se M" : { "start" : "1320021635", "stop" : 1320779121 }, "Se M" : { "start" : "1320021639", "stop" : 1320779121 }, "So" : { "start" : "1320021641", "stop" : 1320779121 } } }
and update it with the following code
> db.users.update({'_id':ObjectId('4e2f0a99a26037e417000056')},{'$set':{'info.Qu.start':'a', 'info.Se.start':'a', 'info.Se I.start':'a', 'info.Se I_Se M.start' : 'a', 'info.Se M.start':'a', 'info.So.start':'a'}})
Everything seems to work out ok, but info.Se actually was not updated but duplicated !
> db.users.findOne() { "_id" : ObjectId("4e2f0a99a26037e417000056"), "info" : { "Qu" : { "start" : "a", "stop" : 1320779121 }, "Se" : { "start" : 1320021628, "stop" : 1320779121 }, "Se I" : { "start" : "a", "stop" : 1320779121 }, "Se I_Se M" : { "start" : "a", "stop" : 1320779121 }, "Se M" : { "start" : "a", "stop" : 1320779121 }, "Se" : { "start" : 1320021628, "stop" : 1320779121 }, "So" : { "start" : "a", "stop" : 1320779121 } } } > db.users.findOne({},{'info.Se':1}) { "_id" : ObjectId("4e2f0a99a26037e417000056"), "info" : { "Se" : { "start" : 1320021628, "stop" : 1320779121 }, "Se" : { "start" : 1320021628, "stop" : 1320779121 } } }