If you want to update a record in mongo db by "_id". Suppose below is a collection(table) with name "ceo" . So now you want to update name "Karm Khanna" with "Salman Ahmad"
So now the update query will be like below :
db.ceo.update({"_id": ObjectId("56ab0b7fac34b55d1aa2b515") }, { $set: {"name": "salman ahmad"}});
Chears
Happy coding :)
So now the update query will be like below :
db.ceo.update({"_id": ObjectId("56ab0b7fac34b55d1aa2b515") }, { $set: {"name": "salman ahmad"}});
Chears
Happy coding :)
Tags:
Mongo Database