ReadonlynameThe name of the store (e.g. 'mongodb', 'redis', 'dynamodb')
ReadonlylibraryThe client library being used
Returns the underlying ioredis client for anything not wrapped here.
Serialize a value with JSON.stringify and SET it.
Optionaloptions: SetOptionsGET a key and JSON.parse it. Returns null if the key is missing.
Optionalcount: numberOptionalcount: numberXADD - append an entry to a stream, creating it if it doesn't exist.
Pass '*' as id to let Redis auto-generate a monotonic
<ms>-<seq> ID (the common case); returns the ID that was assigned.
XRANGE - read entries with IDs between start and end (inclusive), in ID order. Use '-'/'+' for the full range.
Optionalcount: numberXREVRANGE - like xrange() but in reverse ID order; start is the higher/first ID, end the lower/last.
Optionalcount: numberXREAD - read entries newer than ids from one or more streams.
keys[i] is paired with ids[i]; pass '$' for an ID to only read
entries added after the call starts, or '0' to read from the
beginning. With options.block, blocks (up to that many ms, or
forever if 0) waiting for new entries instead of returning
immediately. Returns null if nothing matched (e.g. a non-blocking
read found nothing new).
XLEN - number of entries in a stream.
XDEL - remove specific entries from a stream by ID. Returns the number actually removed.
XTRIM - trim a stream to (approximately) threshold entries
('MAXLEN') or drop entries older than a given ID ('MINID').
Returns the number of entries removed.
XGROUP CREATE - create a consumer group on a stream, starting
delivery from id (default '$', i.e. only new entries). Creates the
stream first (via MKSTREAM) if it doesn't exist yet.
XREADGROUP - read entries from one or more streams as a named
consumer within a consumer group, so entries are tracked in the
group's pending-entries list until xack()'d. Pass '>' for an ID to
receive only entries never delivered to this group; any other ID
re-reads this consumer's already-delivered-but-unacked entries.
XACK - acknowledge that a consumer group has finished processing the given entry IDs.
EVAL - run a Lua script server-side, atomically. keys are passed
as Redis's KEYS[1..N] (and count toward the numkeys argument),
args as ARGV[1..N]. Prefer evalsha() once a script has been
cached (via scriptLoad() or a prior eval()) to avoid resending the
source on every call.
EVALSHA - run a previously cached Lua script by its SHA1 digest
(see scriptLoad()), avoiding the cost of resending the script body.
Redis replies with a NOSCRIPT error (surfaced here as a
DatabaseError) if the script isn't cached on the server.
SCRIPT LOAD - cache a Lua script on the server without executing it,
returning its SHA1 digest for later evalsha() calls.
PFADD - add elements to a HyperLogLog. Returns 1 if the estimated cardinality changed, 0 otherwise.
PFCOUNT - the approximate cardinality of one HyperLogLog, or the union of several.
PFMERGE - merge one or more source HyperLogLogs into destKey (created/overwritten as the union).
Optionalchannel: stringPSUBSCRIBE - subscribe to all channels matching a glob-style pattern
(e.g. news.*, __keyevent@0__:expired) and invoke handler for each
matching message. This is the standard mechanism for consuming Redis
keyspace notifications (e.g. subscribing to
__keyevent@0__:expired to react to key expirations), where the
concrete channel name varies and only a pattern subscription can catch
all of them. Shares the same lazily-created subscriber connection as
subscribe().
PUNSUBSCRIBE - stop receiving messages for pattern (or every pattern
subscription, if omitted). Closes the shared subscriber connection once
both the channel and pattern handler sets are empty.
Optionalpattern: stringQueue multiple commands and send them in a single round trip. Unlike
multi(), commands are not guaranteed atomic — a failure in one
command does not abort the others. Returns the ioredis chainable
commander; call .exec() to run it.
Queue multiple commands to run atomically (Redis MULTI/EXEC). This
is Redis's substitute for cross-key transactions: all queued commands
either all run or (if .discard() is called) none do, but there is no
rollback of partial effects and no cross-command isolation the way a
SQL transaction provides. Returns the ioredis chainable commander;
call .exec() to run it.
RedisStorewraps anioredisclient and exposes Redis's data-structure commands (string/hash/list/set/sorted-set/stream), pub/sub, and pipelining as a typed, promise-based API.