kmongo / org.litote.kmongo.coroutine / CoroutineCollection / updateOneById

updateOneById

suspend fun updateOneById(id: Any, update: Any, options: UpdateOptions = UpdateOptions(), updateOnlyNotNullProperties: Boolean = UpdateConfiguration.updateOnlyNotNullProperties): 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

updateOnlyNotNullProperties - if true do not change null properties

Return
the result of the update one operation

suspend fun updateOneById(clientSession: ClientSession, id: Any, update: Any, 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

id - the object id

update - the update object

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