MongoDB - Update Document
MongoDB's update() and shop() techniques are used to replace report into a group.
MongoDB Update() Method
The replace() method updates the values inside the existing document.Syntax
There are following fundamental syntax of update() techniqueSyntax
The basic syntax of update() method is as follows −
>db.COLLECTION_NAME.Replace(SELECTION_CRITERIA, UPDATED_DATA)
MongoDB Save() Method
The store() technique replaces the present report with the brand new record handed inside the store() technique.
Syntax
The fundamental syntax of MongoDB save() method is proven underneath −
>db.COLLECTION_NAME.Save(_id:ObjectId(),NEW_DATA)