OptionalconditionalSet?: "onlyIfExists" | "onlyIfDoesNotExist"The value to compare the existing value with.
onlyIfEqual - Only set the key if the comparison value equals the current value of key.
IFEQ in the Valkey API.
Optionalexpiry?: "keepExisting" | { count: number; type: TimeUnit }
import {TimeUnit} from "@valkey/valkey-glide";
await client.set(key, JSON.stringify(key), {
expiry: {
type: TimeUnit.Seconds,
count: 60,
},
});
If not set, no expiry time will be set for the value.
keepExisting - Retain the time to live associated with the key.
Equivalent to KEEPTTL in the Valkey API.
OptionalreturnOldValue?: booleanReturn the old string stored at key, or nil if key did not exist. An error
is returned and SET aborted if the value stored at key is not a string.
Equivalent to GET in the Valkey API.
onlyIfDoesNotExist- Only set the key if it does not already exist.NXin the Valkey API.onlyIfExists- Only set the key if it already exists.EXin the Valkey API.