Jul 212011
Update an existing document in MongoDB
Answer:
In an given collection, if you want to perform update on an existing document, the easiest way is to use the following commands.
employee = db.employees.findOne( { name : "Peter" } );
employee.position = "Project Manager";
db.employees.save( employee );
Done.