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