Class that extends the BaseStore class to interact with a Vercel KV database. It provides methods for getting, setting, and deleting data, as well as yielding keys from the database.

Hierarchy

Constructors

  • Parameters

    • Optional fields: {
          client?: VercelKV;
          namespace?: string;
          ttl?: number;
          yieldKeysScanBatchSize?: number;
      }
      • Optional client?: VercelKV
      • Optional namespace?: string
      • Optional ttl?: number
      • Optional yieldKeysScanBatchSize?: number

    Returns VercelKVStore

Properties

client: VercelKV
yieldKeysScanBatchSize: number = 1000
namespace?: string
ttl?: number

Methods

  • Deletes multiple keys from the Redis database.

    Parameters

    • keys: string[]

      Array of keys to be deleted.

    Returns Promise<void>

    Promise that resolves when all keys have been deleted.

  • Gets multiple keys from the Redis database.

    Parameters

    • keys: string[]

      Array of keys to be retrieved.

    Returns Promise<(undefined | Uint8Array)[]>

    An array of retrieved values.

  • Sets multiple keys in the Redis database.

    Parameters

    • keyValuePairs: [string, Uint8Array][]

      Array of key-value pairs to be set.

    Returns Promise<void>

    Promise that resolves when all keys have been set.

  • Yields keys from the Redis database.

    Parameters

    • Optional prefix: string

      Optional prefix to filter the keys.

    Returns AsyncGenerator<string, any, unknown>

    An AsyncGenerator that yields keys from the Redis database.

Generated using TypeDoc