findOneAndReplace
Atomically find a document and replace it.
Return
the document that was replaced. Depending on the value of the returnOriginal property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
Parameters
the query filter to apply the the replace operation
the replacement document
the options to apply to the operation
Atomically find a document and replace it.
Return
the document that was replaced. Depending on the value of the returnOriginal property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
Parameters
the client session with which to associate this operation
the query filter to apply the the replace operation
the replacement document
the options to apply to the operation