kmongo / org.litote.kmongo.rxjava2 / com.mongodb.reactivestreams.client.MongoCollection / deleteOne

deleteOne

fun <T> MongoCollection<T>.deleteOne(filter: String): Maybe<DeleteResult> (source)

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Parameters

filter - the query filter to apply the the delete operation

Return
the result of the remove one operation

fun <T> MongoCollection<T>.deleteOne(clientSession: ClientSession, filter: String): Maybe<DeleteResult> (source)

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Parameters

clientSession - the client session

filter - the query filter to apply the the delete operation

Return
the result of the remove one operation

fun <T> MongoCollection<T>.deleteOne(vararg filters: Bson?): Maybe<DeleteResult> (source)

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Parameters

filters - the query filter to apply the the delete operation

Exceptions

com.mongodb.MongoWriteException -

com.mongodb.MongoWriteConcernException -

com.mongodb.MongoException -

Return
the result of the remove one operation

fun <T> MongoCollection<T>.deleteOne(clientSession: ClientSession, vararg filters: Bson?): Maybe<DeleteResult> (source)

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Parameters

clientSession - the client session

filters - the query filter to apply the the delete operation

Exceptions

com.mongodb.MongoWriteException -

com.mongodb.MongoWriteConcernException -

com.mongodb.MongoException -

Return
the result of the remove one operation