collection.findOneAndDelete
Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.
Arguments
query
(String|ObjectId|Object)[
options
] (Object|String|Array): If theoptions
is a string, it will be parsed as the fields to select.[
callback
] (function)
Returns
A promise.
Example
users.findOneAndDelete({name: 'foo'}).then((doc) => {})