kmongo / org.litote.kmongo.coroutine / updateOne

updateOne

suspend fun <reified T : Any> CoroutineCollection<T>.updateOne(target: T, options: UpdateOptions = UpdateOptions(), updateOnlyNotNullProperties: Boolean = UpdateConfiguration.updateOnlyNotNullProperties): 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

updateOnlyNotNullProperties - if true do not change null properties

Return
the result of the update one operation

suspend fun <reified T : Any> CoroutineCollection<T>.updateOne(clientSession: ClientSession, target: T, options: UpdateOptions = UpdateOptions(), updateOnlyNotNullProperties: Boolean = UpdateConfiguration.updateOnlyNotNullProperties): UpdateResult (source)

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

Parameters

clientSession - the client session with which to associate this operation

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

options - the options to apply to the update operation

updateOnlyNotNullProperties - if true do not change null properties

Return
the result of the update one operation