kmongo / org.litote.kmongo.coroutine / CoroutineCollection / replaceOneById

replaceOneById

suspend fun <T : Any> replaceOneById(id: Any, replacement: T, options: ReplaceOptions = ReplaceOptions()): UpdateResult (source)

Replace a document in the collection according to the specified arguments.

Parameters

id - the object id

replacement - the replacement document

options - the options to apply to the replace operation

Return
the result of the replace one operation

suspend fun replaceOneById(clientSession: ClientSession, id: Any, replacement: T, options: ReplaceOptions = ReplaceOptions()): UpdateResult (source)

Replace a document in the collection according to the specified arguments.

Parameters

clientSession - the client session with which to associate this operation

id - the object id

replacement - the replacement document

options - the options to apply to the replace operation

Return
the result of the replace one operation