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

updateOneById

fun <T> MongoCollection<T>.updateOneById(id: Any, update: Any, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

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

Parameters

id - the object id

update - the update object

options - the options to apply to the update operation

Return
the result of the update one operation

fun <T> MongoCollection<T>.updateOneById(clientSession: ClientSession, id: Any, update: Any, options: UpdateOptions = UpdateOptions()): Maybe<UpdateResult> (source)

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

Parameters

clientSession - the client session

id - the object id

update - the update object

options - the options to apply to the update operation

Return
the result of the update one operation