createRedisJSONStorage
function createRedisJSONStorage(options): RedisLinksStorage;Defined in: src/storage/redis.ts:84
Create a Redis-backed RedisLinksStorage that stores values as native
RedisJSON documents (JSON.SET/JSON.GET) instead of strings. Requires
the JSON module on the server (built into Redis 8; Redis Stack; or
redisjson loaded). Same options and semantics as createRedisStorage.
Do not point it at keys written by createRedisStorage (or vice versa) —
the underlying types differ and Redis answers WRONGTYPE.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
RedisStorageOptions |
Returns
Section titled “Returns”Example
Section titled “Example”import { createRedisJSONStorage } from "@xtandard/links/storage/redis";
const storage = createRedisJSONStorage({ url: process.env.REDIS_URL ?? "redis://localhost:6379", prefix: "myapp:links",});