import { type Deno } from "https://deno.land/x/deno@v1.32.3/cli/tsc/dts/lib.deno.unstable.d.ts";
const { KvMutation } = Deno;
UNSTABLE: New API, yet to be vetted.
A mutation to a key in a Deno.Kv
. A mutation is a
combination of a key, a value, and a type. The type determines how the
mutation is applied to the key.
set
- Sets the value of the key to the given value, overwriting any existing value.delete
- Deletes the key from the database. The mutation is a no-op if the key does not exist.sum
- Adds the given value to the existing value of the key. Both the value specified in the mutation, and any existing value must be of typeDeno.KvU64
. If the key does not exist, the value is set to the given value (summed with 0).max
- Sets the value of the key to the maximum of the existing value and the given value. Both the value specified in the mutation, and any existing value must be of typeDeno.KvU64
. If the key does not exist, the value is set to the given value.min
- Sets the value of the key to the minimum of the existing value and the given value. Both the value specified in the mutation, and any existing value must be of typeDeno.KvU64
. If the key does not exist, the value is set to the given value.