import { AtomicBuilder } from "https://deno.land/x/kvdex@v0.23.1/mod.ts";
Builder object for creating and executing atomic operations in the KV store.
Handles a single collection context at a time, with the option of selecting a new collection context during build.
Constructors
Create a new AtomicBuilder for building and executing atomic operations in the KV store.
Properties
Methods
Add a new document to the KV store with a randomely generated id.
Check if documents have been changed since a specific versionstamp.
Executes the built atomic operation. Will always fail if trying to delete and add/set to the same indexable collection in the same operation.
Add data to the collection queue to be delivered to the queue listener
via db.collection.listenQueue()
. The data will only be received by queue
listeners on the specified collection and topic. The method takes an optional options
argument that can be used to set a delivery delay and topic.
Sets the document value to the maximum of the existing and the given value.
max only works for documents of type Deno.KvU64 and will throw an error for documents of any other type.
Sets the document value to the minimum of the existing and the given value.
min only works for documents of type Deno.KvU64 and will throw an error for documents of any other type.
Specifies atomic mutations to be formed on documents.
Select a new collection context.
Adds the given value to the value of the document with the given id. Sum only works for documents of type Deno.KvU64 and will throw an error for documents of any other type.