1.

Update one document

Answer»

A document stored in the database can be changed using one of several update methods: updateOne, updateMany, and replaceOne. 

updateOne and updateMany take a filter document as their first parameter and a modifier document, which describes changes to make, as the second parameter. 

Command: db.docx.updateOne({"_id": 2}, {$set: {"title": 'revised title'}})




Discussion

No Comment Found