Skip to main content
Deno.AtomicOperation.prototype.set - Deno documentation
method Deno.AtomicOperation.prototype.set
AtomicOperation.prototype.set(
key: KvKey,
value: unknown,
options?: { expireIn?: number; },
): this

Add to the operation a mutation that sets the value of the specified key to the specified value if all checks pass during the commit.

Optionally an expireIn option can be specified to set a time-to-live (TTL) for the key. The TTL is specified in milliseconds, and the key will be deleted from the database at earliest after the specified number of milliseconds have elapsed. Once the specified duration has passed, the key may still be visible for some additional time. If the expireIn option is not specified, the key will not expire.

Parameters

key: KvKey
value: unknown
optional
options: { expireIn?: number; }

Return Type

this