RedisCollectionOptions
Defined in: packages/collection/src/redis.ts:15
Options for RedisCollection.
Type Parameters
Section titled “Type Parameters”V
Properties
Section titled “Properties”client
Section titled “client”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) }.
maxSize?
Section titled “maxSize?”
optionalmaxSize?: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.
onEvict?
Section titled “onEvict?”
optionalonEvict?: (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.
Parameters
Section titled “Parameters”string
V | undefined
reason
Section titled “reason”Returns
Section titled “Returns”void
prefix?
Section titled “prefix?”
optionalprefix?:string
Defined in: packages/collection/src/redis.ts:21
Key prefix. Default "lunibee:collection:"; keys are versioned under it (…v1:…).
serializer?
Section titled “serializer?”
optionalserializer?:RedisSerializer<V>
Defined in: packages/collection/src/redis.ts:29
Default JSON. Provide one for values JSON cannot carry (bigint, Map, Date…).
slide?
Section titled “slide?”
optionalslide?:boolean
Defined in: packages/collection/src/redis.ts:25
Whether a get() restarts a TTL entry’s window. Default true.
optionalttl?:number
Defined in: packages/collection/src/redis.ts:23
Default TTL in ms for set(). Omit for no expiry.