BatchedAtomicOperation.prototype.commit(): Promise<(Deno.KvCommitResult | Deno.KvCommitError)[]>
Commit the operation to the KV store. Returns an array of values indicating
whether checks passed and mutations were performed. If the operation failed
because of a failed check, the last element of the return value will be a
Deno.KvCommitError
with an ok: false
property. If the
operation failed for any other reason (storage error, invalid value, etc.),
the promise will be rejected with an exception. If the operation succeeded,
the return value will be an individual Deno.KvCommitResult
object with a ok: true
property and the versionstamp of the value
committed to KV broken up by the batch size, which defaults to 10
.
If the commit returns ok: false
, one may create a new atomic operation
with updated checks and mutations and attempt to commit it again. See the
note on optimistic locking in the documentation for
Deno.AtomicOperation
.