fun <T> MongoCollection<T>.deleteOneById(id: Any): DeleteResult
(source)
Removes at most one document from the id parameter. If no documents match, the collection is not modified.
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
fun <T> MongoCollection<T>.deleteOneById(clientSession: ClientSession, id: Any): DeleteResult
(source)
Removes at most one document from the id parameter. If no documents match, the collection is not modified.
clientSession
- the client session with which to associate this 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