fun <T> MongoCollection<T>.findOneAndDelete(filter: String, options: FindOneAndDeleteOptions = FindOneAndDeleteOptions()): T?
(source)
Atomically find a document and remove it.
filter
- the query filter to find the document with
options
- the options to apply to the operation
Return
the document that was removed. If no documents matched the query filter, then null will be returned
fun <T> MongoCollection<T>.findOneAndDelete(clientSession: ClientSession, filter: String, options: FindOneAndDeleteOptions = FindOneAndDeleteOptions()): T?
(source)
Atomically find a document and remove it.
clientSession
- the client session with which to associate this operation
filter
- the query filter to find the document with
options
- the options to apply to the operation
Return
the document that was removed. If no documents matched the query filter, then null will be returned