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

updateOne

fun <T> MongoCollection<T>.updateOne(filter: String, update: String, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

Update a single document in the collection according to the specified arguments.

Parameters

filter - a document describing the query filter

update - a document describing the update. The update to apply must include only update operators.

options - the options to apply to the update operation

Return
the result of the update one operation

fun <T> MongoCollection<T>.updateOne(clientSession: ClientSession, filter: String, update: String, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

Update a single document in the collection according to the specified arguments.

Parameters

clientSession - the client session

filter - a document describing the query filter

update - a document describing the update. The update to apply must include only update operators.

options - the options to apply to the update operation

Return
the result of the update one operation

fun <T : Any> MongoCollection<T>.updateOne(filter: String, target: T, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)
fun <T : Any> MongoCollection<T>.updateOne(filter: Bson, target: T, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

Update a single document in the collection according to the specified arguments.

Parameters

filter - a document describing the query filter

target - the update object - must have an non null id

options - the options to apply to the update operation

Return
the result of the update one operation

fun <T : Any> MongoCollection<T>.updateOne(clientSession: ClientSession, filter: String, target: T, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)
fun <T : Any> MongoCollection<T>.updateOne(clientSession: ClientSession, filter: Bson, target: T, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

Update a single document in the collection according to the specified arguments.

Parameters

clientSession - the client session

filter - a document describing the query filter

target - the update object - must have an non null id

options - the options to apply to the update operation

Return
the result of the update one operation

fun <reified T : Any> MongoCollection<T>.updateOne(target: T, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

Update a single document in the collection according to the specified arguments.

Parameters

target - the update object - must have an non null id

options - the options to apply to the update operation

Return
the result of the update one operation

fun <reified T : Any> MongoCollection<T>.updateOne(clientSession: ClientSession, target: T, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

Update a single document in the collection according to the specified arguments.

Parameters

clientSession - the client session

target - the update object - must have an non null id

options - the options to apply to the update operation

Return
the result of the update one operation