findOneAndUpdateSearches for a document and updates only the records in this update document The remaining entries in the found document will remain.
findOneAndReplaceSearches for a document, deletes everything inside this document, and sets up records for this replacement document.
For example:
You have a document{"name":"James", "age":"21"}
findOneAndUpdate {"age":"22"}, {"name":"James", "age":"22"}
findOneAndReplace {"age":"22"}, {"age":"22"} ( )
: findOneAndUpdate Documentation findOneAndReplace Documentation