prorm API Reference
    Preparing search index...

    Class CloudflareKvStore

    CloudflareKvStore wraps the Cloudflare Workers KV REST API behind the NoSqlStore lifecycle and an edge-KV get/set/del/list/incr surface.

    Implements

    Index
    name: "cloudflare-kv" = 'cloudflare-kv'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "fetch" = 'fetch'

    The client library being used

    • Read a key. Returns null on a 404 (missing key).

      Parameters

      • key: string

      Returns Promise<string | null>

    • Write value under key. Strings are stored verbatim; other values are JSON-serialized. options.ttl maps to expiration_ttl (seconds), options.expiration to expiration (absolute Unix seconds).

      Parameters

      Returns Promise<void>

    • List key names, optionally filtered by prefix.

      Parameters

      • Optionalprefix: string

      Returns Promise<string[]>

    • Increment the numeric value at key by by (default 1). Workers KV has no atomic increment, so this is a non-atomic read-modify-write.

      Parameters

      • key: string
      • by: number = 1

      Returns Promise<number>