Update the entire object:
Or just update a single field of a document. In this case age:
You can also update multiple documents simultaneously by adding a third parameter. This query will update all documents where the name equals Tom:
If a new field is coming for update, that field will be added to the document.
If a document is needed to be replaced,
can be used.
Note: Fields you use to identify the object will be saved in the updated document. Field that are not defined in the update section will be removed from the document.