replace

fun replace(cas: Long = 0, createParent: Boolean = true): StoreSemantics

Replace an existing document. Fail if the document does not exist. Fail if a CAS value is specified and it does not match the existing document's CAS value.

Parameters

cas

If non-zero, throw CasMismatchException if the existing document's CAS value does not match this value.

createParent

If false, all mutations throw PathNotFoundException if the target's parent node does not exist. If true, the following mutations will create any missing parent nodes:

  • insert

  • upsert

  • arrayAppend

  • arrayPrepend

  • arrayAddUnique

  • incrementAndGet

  • decrementAndGet