Skip to content

RedisCollectionOptions

Defined in: packages/collection/src/redis.ts:15

Options for RedisCollection.

V

client: RedisCommandClient

Defined in: packages/collection/src/redis.ts:17

The Redis client. Bun.RedisClient works as it is; for ioredis pass { send: (c, a) => redis.call(c, ...a) }.


optional maxSize?: number

Defined in: packages/collection/src/redis.ts:27

Most entries; the least recently used (across every process) are evicted past it.


name: string

Defined in: packages/collection/src/redis.ts:19

The collection’s name: every process using the same name and prefix shares it.


optional onEvict?: (key, value, reason) => void

Defined in: packages/collection/src/redis.ts:31

Called when an operation of this instance removes entries automatically. Exceptions are swallowed.

string

V | undefined

EvictionReason

void


optional prefix?: string

Defined in: packages/collection/src/redis.ts:21

Key prefix. Default "lunibee:collection:"; keys are versioned under it (…v1:…).


optional serializer?: RedisSerializer<V>

Defined in: packages/collection/src/redis.ts:29

Default JSON. Provide one for values JSON cannot carry (bigint, Map, Date…).


optional slide?: boolean

Defined in: packages/collection/src/redis.ts:25

Whether a get() restarts a TTL entry’s window. Default true.


optional ttl?: number

Defined in: packages/collection/src/redis.ts:23

Default TTL in ms for set(). Omit for no expiry.