db.collection.update :
Modifies an existing document or document in the collection. The method can modify the specific fields or documents of an existing document based on the update parameters, or completely replace the existing document.
By default, the update () method updates a single document. Set multiple parameters to update all documents that match the query criteria.
Updates can update multiple documents, but MONGODB only guarantees that the writing of a single document is atomic.
db.collection.findAndModify (document)
Modifies and returns a single document.
When you modify a single document, both the Findandmodify () and the Update () Methods atomically Update the document.
When you update a document, the Findandmodify () and update () methods operate differently:
By default, two actions modify an individual document. However, the update () method with multiple options can modify multiple documents.
If multiple documents match the update criteria, for findandmodify (), you can specify a sort to provide some control over the document to be updated.
Using the default behavior of the update () method, you cannot specify a single document to update when multiple documents match.
By default, Findandmodify () returns a pre-modified version of the document. To obtain an updated document, use the new option.
The update () method returns a Writeresult object that contains the state of the operation. To return to the updated document, use the Find () method. However, other updates may have modified the document between the update and the document retrieval. In addition, if the update modifies only a single document, but multiple documents match, you need to use additional logic to identify the updated document.
Mongodb about update and findandmodify