fun <T> MongoCollection<T>.deleteMany(filter: String, options: DeleteOptions = DeleteOptions()): DeleteResult
(source)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
filter
- the query filter to apply the the delete operation
options
- the options to apply to the delete operation
com.mongodb.MongoWriteException
- if the write failed due some other failure specific to the delete command
com.mongodb.MongoWriteConcernException
- if the write failed due being unable to fulfil the write concern
com.mongodb.MongoException
- if the write failed due some other failure
Return
the result of the remove many operation
fun <T> MongoCollection<T>.deleteMany(vararg filters: Bson?, options: DeleteOptions = DeleteOptions()): DeleteResult
(source)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
filters
- the query filters to apply the the delete operation
options
- the options to apply to the delete operation
com.mongodb.MongoWriteException
- if the write failed due some other failure specific to the delete command
com.mongodb.MongoWriteConcernException
- if the write failed due being unable to fulfil the write concern
com.mongodb.MongoException
- if the write failed due some other failure
Return
the result of the remove many operation
fun <T> MongoCollection<T>.deleteMany(clientSession: ClientSession, filter: String, options: DeleteOptions = DeleteOptions()): DeleteResult
(source)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
clientSession
- the client session with which to associate this operation
filter
- the query filter to apply the the delete operation
options
- the options to apply to the delete operation
com.mongodb.MongoWriteException
- if the write failed due some other failure specific to the delete command
com.mongodb.MongoWriteConcernException
- if the write failed due being unable to fulfil the write concern
com.mongodb.MongoException
- if the write failed due some other failure
Return
the result of the remove many operation
fun <T> MongoCollection<T>.deleteMany(clientSession: ClientSession, vararg filters: Bson?, options: DeleteOptions = DeleteOptions()): DeleteResult
(source)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
clientSession
- the client session with which to associate this operation
filters
- the query filters to apply the the delete operation
options
- the options to apply to the delete operation
com.mongodb.MongoWriteException
- if the write failed due some other failure specific to the delete command
com.mongodb.MongoWriteConcernException
- if the write failed due being unable to fulfil the write concern
com.mongodb.MongoException
- if the write failed due some other failure
Return
the result of the remove many operation