Google Groups

Update Problem


Jay Prakash Mishra May 4, 2012 5:35 AM
Posted in group: mongodb-user
Hi All,

I used the below command to update the "pCity" for candidate ID = 1.
It updated the record successfully, but elements positioning in the
documents has been disturbed.

db.candidates.update({"candidateID":1},{$set:{"pCity":"Mohali"}})

How can I update the pCity only for candidate = 1 without changes of
position of object elements? Please suggest me.