replace

inline suspend fun <T> replace(id: String, content: T, common: CommonOptions = CommonOptions.Default, transcoder: Transcoder? = null, durability: Durability = Durability.none(), expiry: Expiry = Expiry.None, @SinceCouchbase(value = "7.0") preserveExpiry: Boolean = false, cas: Long = 0): MutationResult

Throws

com.couchbase.client.core.error.DocumentNotFoundException

if a document with ID id is not found in the collection.

com.couchbase.client.core.error.CasMismatchException

if cas != 0 and does not match the existing document's CAS value.