@valkey/valkey-glide
    Preparing search index...

    Type Alias SetOptions

    SetOptions: (
        | { conditionalSet?: "onlyIfExists"
        | "onlyIfDoesNotExist" }
        | { comparisonValue: GlideString; conditionalSet: "onlyIfEqual" }
    ) & {
        expiry?: "keepExisting" | { count: number; type: TimeUnit };
        returnOldValue?: boolean;
    }

    Type Declaration

    • { conditionalSet?: "onlyIfExists" | "onlyIfDoesNotExist" }
      • OptionalconditionalSet?: "onlyIfExists" | "onlyIfDoesNotExist"

        onlyIfDoesNotExist - Only set the key if it does not already exist. NX in the Valkey API.

        onlyIfExists - Only set the key if it already exists. EX in the Valkey API.

    • { comparisonValue: GlideString; conditionalSet: "onlyIfEqual" }
      • comparisonValue: GlideString

        The value to compare the existing value with.

      • conditionalSet: "onlyIfEqual"

        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?: boolean

      Return 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.