@upstash/redis 1.40.0 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/{chunk-RLVWMRRX.mjs → chunk-CGMWROAN.mjs} +557 -4
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +557 -4
- package/cloudflare.mjs +1 -1
- package/docs/advanced.mdx +83 -0
- package/docs/commands/array/arcount.mdx +28 -0
- package/docs/commands/array/ardel.mdx +30 -0
- package/docs/commands/array/ardelrange.mdx +32 -0
- package/docs/commands/array/arget.mdx +33 -0
- package/docs/commands/array/argetrange.mdx +38 -0
- package/docs/commands/array/argrep.mdx +69 -0
- package/docs/commands/array/arinfo.mdx +49 -0
- package/docs/commands/array/arinsert.mdx +32 -0
- package/docs/commands/array/arlastitems.mdx +40 -0
- package/docs/commands/array/arlen.mdx +28 -0
- package/docs/commands/array/armget.mdx +31 -0
- package/docs/commands/array/armset.mdx +31 -0
- package/docs/commands/array/arnext.mdx +25 -0
- package/docs/commands/array/arop.mdx +44 -0
- package/docs/commands/array/arring.mdx +36 -0
- package/docs/commands/array/arscan.mdx +42 -0
- package/docs/commands/array/arseek.mdx +34 -0
- package/docs/commands/array/arset.mdx +35 -0
- package/docs/commands/auth/echo.mdx +24 -0
- package/docs/commands/auth/ping.mdx +21 -0
- package/docs/commands/bitmap/bitcount.mdx +39 -0
- package/docs/commands/bitmap/bitop.mdx +142 -0
- package/docs/commands/bitmap/bitpos.mdx +39 -0
- package/docs/commands/bitmap/getbit.mdx +28 -0
- package/docs/commands/bitmap/setbit.mdx +31 -0
- package/docs/commands/connection/client_setinfo.mdx +91 -0
- package/docs/commands/functions/call.mdx +72 -0
- package/docs/commands/functions/call_ro.mdx +57 -0
- package/docs/commands/functions/delete.mdx +22 -0
- package/docs/commands/functions/flush.mdx +16 -0
- package/docs/commands/functions/list.mdx +72 -0
- package/docs/commands/functions/load.mdx +64 -0
- package/docs/commands/functions/stats.mdx +46 -0
- package/docs/commands/generic/del.mdx +29 -0
- package/docs/commands/generic/exists.mdx +26 -0
- package/docs/commands/generic/expire.mdx +29 -0
- package/docs/commands/generic/expireat.mdx +29 -0
- package/docs/commands/generic/keys.mdx +32 -0
- package/docs/commands/generic/persist.mdx +23 -0
- package/docs/commands/generic/pexpire.mdx +28 -0
- package/docs/commands/generic/pexpireat.mdx +29 -0
- package/docs/commands/generic/pttl.mdx +23 -0
- package/docs/commands/generic/randomkey.mdx +21 -0
- package/docs/commands/generic/rename.mdx +28 -0
- package/docs/commands/generic/renamenx.mdx +28 -0
- package/docs/commands/generic/scan.mdx +38 -0
- package/docs/commands/generic/touch.mdx +23 -0
- package/docs/commands/generic/ttl.mdx +23 -0
- package/docs/commands/generic/type.mdx +27 -0
- package/docs/commands/generic/unlink.mdx +29 -0
- package/docs/commands/hash/hdel.mdx +28 -0
- package/docs/commands/hash/hexists.mdx +30 -0
- package/docs/commands/hash/hexpire.mdx +49 -0
- package/docs/commands/hash/hexpireat.mdx +48 -0
- package/docs/commands/hash/hexpiretime.mdx +35 -0
- package/docs/commands/hash/hget.mdx +29 -0
- package/docs/commands/hash/hgetall.mdx +27 -0
- package/docs/commands/hash/hgetdel.mdx +67 -0
- package/docs/commands/hash/hgetex.mdx +123 -0
- package/docs/commands/hash/hincrby.mdx +34 -0
- package/docs/commands/hash/hincrbyfloat.mdx +34 -0
- package/docs/commands/hash/hkeys.mdx +28 -0
- package/docs/commands/hash/hlen.mdx +28 -0
- package/docs/commands/hash/hmget.mdx +33 -0
- package/docs/commands/hash/hpersist.mdx +37 -0
- package/docs/commands/hash/hpexpire.mdx +50 -0
- package/docs/commands/hash/hpexpireat.mdx +48 -0
- package/docs/commands/hash/hpexpiretime.mdx +35 -0
- package/docs/commands/hash/hpttl.mdx +35 -0
- package/docs/commands/hash/hrandfield.mdx +57 -0
- package/docs/commands/hash/hscan.mdx +65 -0
- package/docs/commands/hash/hset.mdx +32 -0
- package/docs/commands/hash/hsetex.mdx +186 -0
- package/docs/commands/hash/hsetnx.mdx +30 -0
- package/docs/commands/hash/hstrlen.mdx +28 -0
- package/docs/commands/hash/httl.mdx +35 -0
- package/docs/commands/hash/hvals.mdx +29 -0
- package/docs/commands/json/arrappend.mdx +35 -0
- package/docs/commands/json/arrindex.mdx +37 -0
- package/docs/commands/json/arrinsert.mdx +34 -0
- package/docs/commands/json/arrlen.mdx +26 -0
- package/docs/commands/json/arrpop.mdx +36 -0
- package/docs/commands/json/arrtrim.mdx +34 -0
- package/docs/commands/json/clear.mdx +30 -0
- package/docs/commands/json/del.mdx +26 -0
- package/docs/commands/json/forget.mdx +26 -0
- package/docs/commands/json/get.mdx +53 -0
- package/docs/commands/json/merge.mdx +32 -0
- package/docs/commands/json/mget.mdx +27 -0
- package/docs/commands/json/mset.mdx +26 -0
- package/docs/commands/json/numincrby.mdx +33 -0
- package/docs/commands/json/nummultby.mdx +33 -0
- package/docs/commands/json/objkeys.mdx +27 -0
- package/docs/commands/json/objlen.mdx +27 -0
- package/docs/commands/json/set.mdx +42 -0
- package/docs/commands/json/strappend.mdx +32 -0
- package/docs/commands/json/strlen.mdx +26 -0
- package/docs/commands/json/toggle.mdx +28 -0
- package/docs/commands/json/type.mdx +28 -0
- package/docs/commands/list/lindex.mdx +32 -0
- package/docs/commands/list/linsert.mdx +41 -0
- package/docs/commands/list/llen.mdx +26 -0
- package/docs/commands/list/lmove.mdx +34 -0
- package/docs/commands/list/lpop.mdx +37 -0
- package/docs/commands/list/lpos.mdx +56 -0
- package/docs/commands/list/lpush.mdx +32 -0
- package/docs/commands/list/lpushx.mdx +38 -0
- package/docs/commands/list/lrange.mdx +37 -0
- package/docs/commands/list/lrem.mdx +33 -0
- package/docs/commands/list/lset.mdx +34 -0
- package/docs/commands/list/ltrim.mdx +33 -0
- package/docs/commands/list/rpop.mdx +37 -0
- package/docs/commands/list/rpush.mdx +32 -0
- package/docs/commands/list/rpushx.mdx +38 -0
- package/docs/commands/overview.mdx +692 -0
- package/docs/commands/pubsub/psubscribe.mdx +36 -0
- package/docs/commands/pubsub/publish.mdx +27 -0
- package/docs/commands/pubsub/subscribe.mdx +28 -0
- package/docs/commands/scripts/eval.mdx +36 -0
- package/docs/commands/scripts/eval_ro.mdx +36 -0
- package/docs/commands/scripts/evalsha.mdx +36 -0
- package/docs/commands/scripts/evalsha_ro.mdx +36 -0
- package/docs/commands/scripts/script_exists.mdx +26 -0
- package/docs/commands/scripts/script_flush.mdx +28 -0
- package/docs/commands/scripts/script_load.mdx +28 -0
- package/docs/commands/server/dbsize.mdx +22 -0
- package/docs/commands/server/flushall.mdx +25 -0
- package/docs/commands/server/flushdb.mdx +25 -0
- package/docs/commands/set/sadd.mdx +32 -0
- package/docs/commands/set/scard.mdx +26 -0
- package/docs/commands/set/sdiff.mdx +27 -0
- package/docs/commands/set/sdiffstore.mdx +32 -0
- package/docs/commands/set/sinter.mdx +27 -0
- package/docs/commands/set/sinterstore.mdx +33 -0
- package/docs/commands/set/sismember.mdx +30 -0
- package/docs/commands/set/smembers.mdx +25 -0
- package/docs/commands/set/smismember.mdx +31 -0
- package/docs/commands/set/smove.mdx +34 -0
- package/docs/commands/set/spop.mdx +36 -0
- package/docs/commands/set/srandmember.mdx +36 -0
- package/docs/commands/set/srem.mdx +29 -0
- package/docs/commands/set/sscan.mdx +39 -0
- package/docs/commands/set/sunion.mdx +27 -0
- package/docs/commands/set/sunionstore.mdx +33 -0
- package/docs/commands/stream/xack.mdx +37 -0
- package/docs/commands/stream/xackdel.mdx +211 -0
- package/docs/commands/stream/xadd.mdx +137 -0
- package/docs/commands/stream/xautoclaim.mdx +80 -0
- package/docs/commands/stream/xclaim.mdx +84 -0
- package/docs/commands/stream/xdel.mdx +34 -0
- package/docs/commands/stream/xdelex.mdx +119 -0
- package/docs/commands/stream/xgroup.mdx +141 -0
- package/docs/commands/stream/xinfo.mdx +77 -0
- package/docs/commands/stream/xlen.mdx +22 -0
- package/docs/commands/stream/xpending.mdx +75 -0
- package/docs/commands/stream/xrange.mdx +59 -0
- package/docs/commands/stream/xread.mdx +65 -0
- package/docs/commands/stream/xreadgroup.mdx +87 -0
- package/docs/commands/stream/xrevrange.mdx +65 -0
- package/docs/commands/stream/xtrim.mdx +75 -0
- package/docs/commands/string/append.mdx +28 -0
- package/docs/commands/string/decr.mdx +27 -0
- package/docs/commands/string/decrby.mdx +30 -0
- package/docs/commands/string/get.mdx +34 -0
- package/docs/commands/string/getdel.mdx +29 -0
- package/docs/commands/string/getrange.mdx +34 -0
- package/docs/commands/string/getset.mdx +28 -0
- package/docs/commands/string/incr.mdx +27 -0
- package/docs/commands/string/incrby.mdx +30 -0
- package/docs/commands/string/incrbyfloat.mdx +30 -0
- package/docs/commands/string/mget.mdx +31 -0
- package/docs/commands/string/mset.mdx +32 -0
- package/docs/commands/string/msetnx.mdx +29 -0
- package/docs/commands/string/set.mdx +79 -0
- package/docs/commands/string/setrange.mdx +38 -0
- package/docs/commands/string/strlen.mdx +26 -0
- package/docs/commands/transaction.mdx +22 -0
- package/docs/commands/zset/zadd.mdx +102 -0
- package/docs/commands/zset/zcard.mdx +31 -0
- package/docs/commands/zset/zcount.mdx +47 -0
- package/docs/commands/zset/zdiffstore.mdx +33 -0
- package/docs/commands/zset/zincrby.mdx +37 -0
- package/docs/commands/zset/zinterstore.mdx +98 -0
- package/docs/commands/zset/zlexcount.mdx +43 -0
- package/docs/commands/zset/zmscore.mdx +34 -0
- package/docs/commands/zset/zpopmax.mdx +25 -0
- package/docs/commands/zset/zpopmin.mdx +25 -0
- package/docs/commands/zset/zrange.mdx +85 -0
- package/docs/commands/zset/zrank.mdx +29 -0
- package/docs/commands/zset/zrem.mdx +33 -0
- package/docs/commands/zset/zremrangebylex.mdx +32 -0
- package/docs/commands/zset/zremrangebyrank.mdx +32 -0
- package/docs/commands/zset/zremrangebyscore.mdx +32 -0
- package/docs/commands/zset/zrevrank.mdx +29 -0
- package/docs/commands/zset/zscan.mdx +58 -0
- package/docs/commands/zset/zscore.mdx +34 -0
- package/docs/commands/zset/zunionstore.mdx +98 -0
- package/docs/deployment.mdx +117 -0
- package/docs/developing.mdx +118 -0
- package/docs/getstarted.mdx +68 -0
- package/docs/overview.mdx +29 -0
- package/docs/pipelining/auto-pipeline.mdx +108 -0
- package/docs/pipelining/pipeline-transaction.mdx +65 -0
- package/docs/retries.mdx +24 -0
- package/docs/troubleshooting.mdx +80 -0
- package/{error-BNzLTXJG.d.mts → error-4e36-PC0.d.mts} +838 -8
- package/{error-BNzLTXJG.d.ts → error-4e36-PC0.d.ts} +838 -8
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +557 -4
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +34 -2
- package/nodejs.d.ts +34 -2
- package/nodejs.js +586 -4
- package/nodejs.mjs +30 -1
- package/package.json +16 -5
- package/src/pkg/auto-pipeline.ts +284 -0
- package/src/pkg/commands/append.ts +12 -0
- package/src/pkg/commands/arcount.ts +14 -0
- package/src/pkg/commands/ardel.ts +19 -0
- package/src/pkg/commands/ardelrange.ts +19 -0
- package/src/pkg/commands/arget.ts +17 -0
- package/src/pkg/commands/argetrange.ts +20 -0
- package/src/pkg/commands/argrep.ts +109 -0
- package/src/pkg/commands/arinfo.ts +88 -0
- package/src/pkg/commands/arinsert.ts +24 -0
- package/src/pkg/commands/arlastitems.ts +29 -0
- package/src/pkg/commands/arlen.ts +23 -0
- package/src/pkg/commands/armget.ts +18 -0
- package/src/pkg/commands/armset.ts +26 -0
- package/src/pkg/commands/arnext.ts +20 -0
- package/src/pkg/commands/arop.ts +48 -0
- package/src/pkg/commands/arring.ts +23 -0
- package/src/pkg/commands/arscan.ts +44 -0
- package/src/pkg/commands/arseek.ts +17 -0
- package/src/pkg/commands/arset.ts +20 -0
- package/src/pkg/commands/bitcount.ts +30 -0
- package/src/pkg/commands/bitfield.ts +50 -0
- package/src/pkg/commands/bitop.ts +35 -0
- package/src/pkg/commands/bitpos.ts +15 -0
- package/src/pkg/commands/client_setinfo.ts +17 -0
- package/src/pkg/commands/command.ts +142 -0
- package/src/pkg/commands/copy.ts +22 -0
- package/src/pkg/commands/dbsize.ts +12 -0
- package/src/pkg/commands/decr.ts +12 -0
- package/src/pkg/commands/decrby.ts +12 -0
- package/src/pkg/commands/del.ts +12 -0
- package/src/pkg/commands/echo.ts +12 -0
- package/src/pkg/commands/eval.ts +18 -0
- package/src/pkg/commands/evalRo.ts +18 -0
- package/src/pkg/commands/evalsha.ts +18 -0
- package/src/pkg/commands/evalshaRo.ts +18 -0
- package/src/pkg/commands/exec.ts +23 -0
- package/src/pkg/commands/exists.ts +12 -0
- package/src/pkg/commands/expire.ts +13 -0
- package/src/pkg/commands/expireat.ts +16 -0
- package/src/pkg/commands/fcall.ts +15 -0
- package/src/pkg/commands/fcall_ro.ts +18 -0
- package/src/pkg/commands/flushall.ts +15 -0
- package/src/pkg/commands/flushdb.ts +15 -0
- package/src/pkg/commands/function_delete.ts +12 -0
- package/src/pkg/commands/function_flush.ts +12 -0
- package/src/pkg/commands/function_list.ts +77 -0
- package/src/pkg/commands/function_load.ts +31 -0
- package/src/pkg/commands/function_stats.ts +42 -0
- package/src/pkg/commands/geo_add.ts +54 -0
- package/src/pkg/commands/geo_dist.ts +19 -0
- package/src/pkg/commands/geo_hash.ts +23 -0
- package/src/pkg/commands/geo_pos.ts +39 -0
- package/src/pkg/commands/geo_search.ts +140 -0
- package/src/pkg/commands/geo_search_store.ts +69 -0
- package/src/pkg/commands/get.ts +15 -0
- package/src/pkg/commands/getbit.ts +12 -0
- package/src/pkg/commands/getdel.ts +15 -0
- package/src/pkg/commands/getex.ts +36 -0
- package/src/pkg/commands/getrange.ts +15 -0
- package/src/pkg/commands/getset.ts +15 -0
- package/src/pkg/commands/hdel.ts +12 -0
- package/src/pkg/commands/hexists.ts +12 -0
- package/src/pkg/commands/hexpire.ts +30 -0
- package/src/pkg/commands/hexpireat.ts +30 -0
- package/src/pkg/commands/hexpiretime.ts +13 -0
- package/src/pkg/commands/hget.ts +18 -0
- package/src/pkg/commands/hgetall.ts +44 -0
- package/src/pkg/commands/hgetdel.ts +30 -0
- package/src/pkg/commands/hgetex.ts +56 -0
- package/src/pkg/commands/hincrby.ts +15 -0
- package/src/pkg/commands/hincrbyfloat.ts +15 -0
- package/src/pkg/commands/hkeys.ts +12 -0
- package/src/pkg/commands/hlen.ts +12 -0
- package/src/pkg/commands/hmget.ts +53 -0
- package/src/pkg/commands/hmset.ts +14 -0
- package/src/pkg/commands/hpersist.ts +13 -0
- package/src/pkg/commands/hpexpire.ts +30 -0
- package/src/pkg/commands/hpexpireat.ts +30 -0
- package/src/pkg/commands/hpexpiretime.ts +13 -0
- package/src/pkg/commands/hpttl.ts +13 -0
- package/src/pkg/commands/hrandfield.ts +52 -0
- package/src/pkg/commands/hscan.ts +31 -0
- package/src/pkg/commands/hset.ts +15 -0
- package/src/pkg/commands/hsetex.ts +59 -0
- package/src/pkg/commands/hsetnx.ts +15 -0
- package/src/pkg/commands/hstrlen.ts +12 -0
- package/src/pkg/commands/httl.ts +13 -0
- package/src/pkg/commands/hvals.ts +12 -0
- package/src/pkg/commands/incr.ts +12 -0
- package/src/pkg/commands/incrby.ts +12 -0
- package/src/pkg/commands/incrbyfloat.ts +12 -0
- package/src/pkg/commands/json_arrappend.ts +18 -0
- package/src/pkg/commands/json_arrindex.ts +15 -0
- package/src/pkg/commands/json_arrinsert.ts +18 -0
- package/src/pkg/commands/json_arrlen.ts +15 -0
- package/src/pkg/commands/json_arrpop.ts +15 -0
- package/src/pkg/commands/json_arrtrim.ts +19 -0
- package/src/pkg/commands/json_clear.ts +12 -0
- package/src/pkg/commands/json_del.ts +12 -0
- package/src/pkg/commands/json_forget.ts +12 -0
- package/src/pkg/commands/json_get.ts +45 -0
- package/src/pkg/commands/json_merge.ts +18 -0
- package/src/pkg/commands/json_mget.ts +12 -0
- package/src/pkg/commands/json_mset.ts +27 -0
- package/src/pkg/commands/json_numincrby.ts +15 -0
- package/src/pkg/commands/json_nummultby.ts +15 -0
- package/src/pkg/commands/json_objkeys.ts +15 -0
- package/src/pkg/commands/json_objlen.ts +15 -0
- package/src/pkg/commands/json_resp.ts +11 -0
- package/src/pkg/commands/json_set.ts +35 -0
- package/src/pkg/commands/json_strappend.ts +15 -0
- package/src/pkg/commands/json_strlen.ts +15 -0
- package/src/pkg/commands/json_toggle.ts +12 -0
- package/src/pkg/commands/json_type.ts +12 -0
- package/src/pkg/commands/keys.ts +12 -0
- package/src/pkg/commands/lindex.ts +11 -0
- package/src/pkg/commands/linsert.ts +10 -0
- package/src/pkg/commands/llen.ts +12 -0
- package/src/pkg/commands/lmove.ts +20 -0
- package/src/pkg/commands/lmpop.ts +19 -0
- package/src/pkg/commands/lpop.ts +18 -0
- package/src/pkg/commands/lpos.ts +26 -0
- package/src/pkg/commands/lpush.ts +12 -0
- package/src/pkg/commands/lpushx.ts +12 -0
- package/src/pkg/commands/lrange.ts +11 -0
- package/src/pkg/commands/lrem.ts +10 -0
- package/src/pkg/commands/lset.ts +8 -0
- package/src/pkg/commands/ltrim.ts +8 -0
- package/src/pkg/commands/mget.ts +15 -0
- package/src/pkg/commands/mod.ts +222 -0
- package/src/pkg/commands/mset.ts +12 -0
- package/src/pkg/commands/msetnx.ts +12 -0
- package/src/pkg/commands/persist.ts +12 -0
- package/src/pkg/commands/pexpire.ts +16 -0
- package/src/pkg/commands/pexpireat.ts +16 -0
- package/src/pkg/commands/pfadd.ts +11 -0
- package/src/pkg/commands/pfcount.ts +11 -0
- package/src/pkg/commands/pfmerge.ts +11 -0
- package/src/pkg/commands/ping.ts +15 -0
- package/src/pkg/commands/psetex.ts +14 -0
- package/src/pkg/commands/psubscribe.ts +26 -0
- package/src/pkg/commands/pttl.ts +12 -0
- package/src/pkg/commands/publish.ts +12 -0
- package/src/pkg/commands/randomkey.ts +12 -0
- package/src/pkg/commands/rename.ts +12 -0
- package/src/pkg/commands/renamenx.ts +12 -0
- package/src/pkg/commands/rpop.ts +21 -0
- package/src/pkg/commands/rpush.ts +12 -0
- package/src/pkg/commands/rpushx.ts +12 -0
- package/src/pkg/commands/sadd.ts +15 -0
- package/src/pkg/commands/scan.ts +63 -0
- package/src/pkg/commands/scard.ts +11 -0
- package/src/pkg/commands/script_exists.ts +15 -0
- package/src/pkg/commands/script_flush.ts +22 -0
- package/src/pkg/commands/script_load.ts +12 -0
- package/src/pkg/commands/sdiff.ts +11 -0
- package/src/pkg/commands/sdiffstore.ts +14 -0
- package/src/pkg/commands/search/command-builder.ts +162 -0
- package/src/pkg/commands/search/index.ts +4 -0
- package/src/pkg/commands/search/schema-builder.ts +320 -0
- package/src/pkg/commands/search/search.ts +218 -0
- package/src/pkg/commands/search/types.ts +1029 -0
- package/src/pkg/commands/search/utils.ts +275 -0
- package/src/pkg/commands/set.ts +52 -0
- package/src/pkg/commands/setbit.ts +15 -0
- package/src/pkg/commands/setex.ts +11 -0
- package/src/pkg/commands/setnx.ts +11 -0
- package/src/pkg/commands/setrange.ts +15 -0
- package/src/pkg/commands/sinter.ts +11 -0
- package/src/pkg/commands/sintercard.ts +19 -0
- package/src/pkg/commands/sinterstore.ts +14 -0
- package/src/pkg/commands/sismember.ts +11 -0
- package/src/pkg/commands/smembers.ts +12 -0
- package/src/pkg/commands/smismember.ts +17 -0
- package/src/pkg/commands/smove.ts +14 -0
- package/src/pkg/commands/spop.ts +18 -0
- package/src/pkg/commands/srandmember.ts +18 -0
- package/src/pkg/commands/srem.ts +11 -0
- package/src/pkg/commands/sscan.ts +31 -0
- package/src/pkg/commands/strlen.ts +12 -0
- package/src/pkg/commands/subscribe.ts +254 -0
- package/src/pkg/commands/sunion.ts +12 -0
- package/src/pkg/commands/sunionstore.ts +15 -0
- package/src/pkg/commands/time.ts +10 -0
- package/src/pkg/commands/touch.ts +12 -0
- package/src/pkg/commands/ttl.ts +12 -0
- package/src/pkg/commands/type.ts +13 -0
- package/src/pkg/commands/types.ts +201 -0
- package/src/pkg/commands/unlink.ts +12 -0
- package/src/pkg/commands/vector/index.ts +11 -0
- package/src/pkg/commands/vector/types.ts +63 -0
- package/src/pkg/commands/vector/utils.ts +67 -0
- package/src/pkg/commands/vector/vector.ts +131 -0
- package/src/pkg/commands/vector_add.ts +18 -0
- package/src/pkg/commands/vector_count.ts +11 -0
- package/src/pkg/commands/vector_create.ts +28 -0
- package/src/pkg/commands/vector_del.ts +13 -0
- package/src/pkg/commands/vector_drop.ts +13 -0
- package/src/pkg/commands/vector_get.ts +18 -0
- package/src/pkg/commands/vector_info.ts +25 -0
- package/src/pkg/commands/vector_query.ts +24 -0
- package/src/pkg/commands/xack.ts +16 -0
- package/src/pkg/commands/xackdel.ts +21 -0
- package/src/pkg/commands/xadd.ts +70 -0
- package/src/pkg/commands/xautoclaim.ts +31 -0
- package/src/pkg/commands/xclaim.ts +56 -0
- package/src/pkg/commands/xdel.ts +16 -0
- package/src/pkg/commands/xdelex.ts +25 -0
- package/src/pkg/commands/xgroup.ts +101 -0
- package/src/pkg/commands/xinfo.ts +28 -0
- package/src/pkg/commands/xlen.ts +12 -0
- package/src/pkg/commands/xpending.ts +44 -0
- package/src/pkg/commands/xrange.ts +49 -0
- package/src/pkg/commands/xread.ts +78 -0
- package/src/pkg/commands/xreadgroup.ts +74 -0
- package/src/pkg/commands/xrevrange.ts +48 -0
- package/src/pkg/commands/xtrim.ts +25 -0
- package/src/pkg/commands/zadd.ts +54 -0
- package/src/pkg/commands/zcard.ts +12 -0
- package/src/pkg/commands/zcount.ts +14 -0
- package/src/pkg/commands/zdiffstore.ts +15 -0
- package/src/pkg/commands/zincrby.ts +14 -0
- package/src/pkg/commands/zinterstore.ts +51 -0
- package/src/pkg/commands/zlexcount.ts +11 -0
- package/src/pkg/commands/zmscore.ts +16 -0
- package/src/pkg/commands/zpopmax.ts +18 -0
- package/src/pkg/commands/zpopmin.ts +18 -0
- package/src/pkg/commands/zrange.ts +72 -0
- package/src/pkg/commands/zrank.ts +14 -0
- package/src/pkg/commands/zrem.ts +11 -0
- package/src/pkg/commands/zremrangebylex.ts +11 -0
- package/src/pkg/commands/zremrangebyrank.ts +14 -0
- package/src/pkg/commands/zremrangebyscore.ts +18 -0
- package/src/pkg/commands/zrevrank.ts +14 -0
- package/src/pkg/commands/zscan.ts +31 -0
- package/src/pkg/commands/zscore.ts +15 -0
- package/src/pkg/commands/zunion.ts +54 -0
- package/src/pkg/commands/zunionstore.ts +52 -0
- package/src/pkg/error.ts +28 -0
- package/src/pkg/http.ts +458 -0
- package/src/pkg/index.ts +1 -0
- package/src/pkg/pipeline.ts +2041 -0
- package/src/pkg/redis.ts +2130 -0
- package/src/pkg/script.ts +100 -0
- package/src/pkg/scriptRo.ts +98 -0
- package/src/pkg/types.ts +35 -0
- package/src/pkg/util.ts +115 -0
- package/src/platforms/cloudflare.ts +162 -0
- package/src/platforms/fastly.ts +105 -0
- package/src/platforms/nodejs.ts +231 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XAUTOCLAIM
|
|
3
|
+
description: Changes the ownership of pending messages from one consumer to another in a stream consumer group.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
<ParamField body="group" type="string" required>
|
|
13
|
+
The consumer group name.
|
|
14
|
+
</ParamField>
|
|
15
|
+
|
|
16
|
+
<ParamField body="consumer" type="string" required>
|
|
17
|
+
The consumer name that will claim the messages.
|
|
18
|
+
</ParamField>
|
|
19
|
+
|
|
20
|
+
<ParamField body="minIdleTime" type="number" required>
|
|
21
|
+
The minimum idle time in milliseconds for messages to be claimed.
|
|
22
|
+
</ParamField>
|
|
23
|
+
|
|
24
|
+
<ParamField body="start" type="string" required>
|
|
25
|
+
The stream entry ID to start claiming from.
|
|
26
|
+
</ParamField>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
<ParamField body="options" type="object">
|
|
30
|
+
<Expandable title="options">
|
|
31
|
+
<ParamField body="count" type="number">
|
|
32
|
+
The maximum number of messages to claim.
|
|
33
|
+
</ParamField>
|
|
34
|
+
<ParamField body="justid" type="boolean">
|
|
35
|
+
Return only the message IDs instead of the full message data.
|
|
36
|
+
</ParamField>
|
|
37
|
+
</Expandable>
|
|
38
|
+
</ParamField>
|
|
39
|
+
|
|
40
|
+
## Response
|
|
41
|
+
|
|
42
|
+
<ResponseField type="[string, Array<[string, string[]]>, string[]]">
|
|
43
|
+
Returns a tuple containing:
|
|
44
|
+
- Next start ID for pagination
|
|
45
|
+
- Array of claimed messages (ID and field-value pairs)
|
|
46
|
+
- Array of deleted message IDs
|
|
47
|
+
</ResponseField>
|
|
48
|
+
|
|
49
|
+
<RequestExample>
|
|
50
|
+
```ts Basic autoclaim
|
|
51
|
+
const result = await redis.xautoclaim(
|
|
52
|
+
"mystream",
|
|
53
|
+
"mygroup",
|
|
54
|
+
"consumer1",
|
|
55
|
+
60000,
|
|
56
|
+
"0-0"
|
|
57
|
+
);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```ts With count and justid
|
|
61
|
+
const result = await redis.xautoclaim(
|
|
62
|
+
"mystream",
|
|
63
|
+
"mygroup",
|
|
64
|
+
"consumer1",
|
|
65
|
+
60000,
|
|
66
|
+
"0-0",
|
|
67
|
+
{ count: 5, justid: true }
|
|
68
|
+
);
|
|
69
|
+
```
|
|
70
|
+
</RequestExample>
|
|
71
|
+
|
|
72
|
+
<ResponseExample>
|
|
73
|
+
```ts
|
|
74
|
+
[
|
|
75
|
+
"1638360173533-1", // next start ID
|
|
76
|
+
[["1638360173533-0", ["field1", "value1", "field2", "value2"]]], // claimed messages
|
|
77
|
+
[] // deleted message IDs
|
|
78
|
+
]
|
|
79
|
+
```
|
|
80
|
+
</ResponseExample>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XCLAIM
|
|
3
|
+
description: Changes the ownership of pending messages from one consumer to another in a stream consumer group.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
<ParamField body="group" type="string" required>
|
|
13
|
+
The consumer group name.
|
|
14
|
+
</ParamField>
|
|
15
|
+
|
|
16
|
+
<ParamField body="consumer" type="string" required>
|
|
17
|
+
The consumer name that will claim the messages.
|
|
18
|
+
</ParamField>
|
|
19
|
+
|
|
20
|
+
<ParamField body="minIdleTime" type="number" required>
|
|
21
|
+
The minimum idle time in milliseconds for messages to be claimed.
|
|
22
|
+
</ParamField>
|
|
23
|
+
|
|
24
|
+
<ParamField body="ids" type="string | string[]" required>
|
|
25
|
+
The ID(s) of the message(s) to claim. Can be a single ID or an array of IDs.
|
|
26
|
+
</ParamField>
|
|
27
|
+
|
|
28
|
+
<ParamField body="options">
|
|
29
|
+
<Expandable title="options">
|
|
30
|
+
<ParamField body="idle" type="number">
|
|
31
|
+
Set the idle time of the message.
|
|
32
|
+
</ParamField>
|
|
33
|
+
<ParamField body="time" type="number">
|
|
34
|
+
Set the idle time to a specific Unix time.
|
|
35
|
+
</ParamField>
|
|
36
|
+
<ParamField body="retryCount" type="number">
|
|
37
|
+
Set the retry counter to the specified value.
|
|
38
|
+
</ParamField>
|
|
39
|
+
<ParamField body="force" type="boolean">
|
|
40
|
+
Create the pending message entry even if certain IDs are not already pending.
|
|
41
|
+
</ParamField>
|
|
42
|
+
<ParamField body="justid" type="boolean">
|
|
43
|
+
Return only the message IDs instead of the full message data.
|
|
44
|
+
</ParamField>
|
|
45
|
+
</Expandable>
|
|
46
|
+
</ParamField>
|
|
47
|
+
|
|
48
|
+
## Response
|
|
49
|
+
|
|
50
|
+
<ResponseField type="Array<[string, string[]]> | string[]">
|
|
51
|
+
Returns an array of claimed messages. If `justid` option is used, returns only message IDs.
|
|
52
|
+
</ResponseField>
|
|
53
|
+
|
|
54
|
+
<RequestExample>
|
|
55
|
+
```ts Basic claim
|
|
56
|
+
const result = await redis.xclaim(
|
|
57
|
+
"mystream",
|
|
58
|
+
"mygroup",
|
|
59
|
+
"consumer1",
|
|
60
|
+
60000,
|
|
61
|
+
["1638360173533-0", "1638360173533-1"]
|
|
62
|
+
);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```ts With justid option
|
|
66
|
+
const result = await redis.xclaim(
|
|
67
|
+
"mystream",
|
|
68
|
+
"mygroup",
|
|
69
|
+
"consumer1",
|
|
70
|
+
60000,
|
|
71
|
+
["1638360173533-0"],
|
|
72
|
+
{ justid: true, force: true }
|
|
73
|
+
);
|
|
74
|
+
```
|
|
75
|
+
</RequestExample>
|
|
76
|
+
|
|
77
|
+
<ResponseExample>
|
|
78
|
+
```ts
|
|
79
|
+
[
|
|
80
|
+
["1638360173533-0", ["field1", "value1", "field2", "value2"]],
|
|
81
|
+
["1638360173533-1", ["field1", "value3", "field2", "value4"]]
|
|
82
|
+
]
|
|
83
|
+
```
|
|
84
|
+
</ResponseExample>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XDEL
|
|
3
|
+
description: Removes the specified entries from a stream, and returns the number of entries deleted.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
<ParamField body="ids" type="string | string[]" required>
|
|
13
|
+
The ID(s) of the message(s) to delete. Can be a single ID or an array of IDs.
|
|
14
|
+
</ParamField>
|
|
15
|
+
|
|
16
|
+
## Response
|
|
17
|
+
|
|
18
|
+
<ResponseField type="number">
|
|
19
|
+
The number of entries actually deleted from the stream.
|
|
20
|
+
</ResponseField>
|
|
21
|
+
|
|
22
|
+
<RequestExample>
|
|
23
|
+
```ts Single message
|
|
24
|
+
const result = await redis.xdel("mystream", "1638360173533-0");
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```ts Multiple messages
|
|
28
|
+
const result = await redis.xdel("mystream", [
|
|
29
|
+
"1638360173533-0",
|
|
30
|
+
"1638360173533-1",
|
|
31
|
+
"1638360173533-2"
|
|
32
|
+
]);
|
|
33
|
+
```
|
|
34
|
+
</RequestExample>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XDELEX
|
|
3
|
+
description: Extended delete for streams with reference control.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The `XDELEX` command provides extended deletion capabilities for stream entries with additional control options. This is an enhanced version of XDEL with more advanced features for managing stream data.
|
|
7
|
+
|
|
8
|
+
## Arguments
|
|
9
|
+
|
|
10
|
+
<ParamField body="key" type="string" required>
|
|
11
|
+
The key of the stream.
|
|
12
|
+
</ParamField>
|
|
13
|
+
|
|
14
|
+
<ParamField body="option" type="'KEEPREF' | 'keepref' | 'DELREF' | 'delref' | 'ACKED' | 'acked'">
|
|
15
|
+
Optional deletion behavior (case-insensitive). When provided, must come before the IDs:
|
|
16
|
+
- `KEEPREF`: Keep consumer group references
|
|
17
|
+
- `DELREF`: Delete consumer group references
|
|
18
|
+
- `ACKED`: Only acknowledge messages (don't delete)
|
|
19
|
+
|
|
20
|
+
If not provided, entries are deleted by default.
|
|
21
|
+
</ParamField>
|
|
22
|
+
|
|
23
|
+
<ParamField body="ids" type="...string[]" required>
|
|
24
|
+
One or more stream entry IDs to delete. When an option is provided, IDs must come after the option.
|
|
25
|
+
</ParamField>
|
|
26
|
+
|
|
27
|
+
## Response
|
|
28
|
+
|
|
29
|
+
<ResponseField type="number[]" required>
|
|
30
|
+
An array of numbers indicating the result for each ID in the same order as provided.
|
|
31
|
+
</ResponseField>
|
|
32
|
+
|
|
33
|
+
<RequestExample>
|
|
34
|
+
```ts Single Entry
|
|
35
|
+
// Delete a single stream entry
|
|
36
|
+
const result = await redis.xdelex("mystream", "1638360173533-0");
|
|
37
|
+
console.log(result); // Array of results for each ID
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```ts Multiple Entries
|
|
41
|
+
// Delete multiple stream entries
|
|
42
|
+
const result = await redis.xdelex(
|
|
43
|
+
"mystream",
|
|
44
|
+
"1638360173533-0",
|
|
45
|
+
"1638360173533-1",
|
|
46
|
+
"1638360173533-2"
|
|
47
|
+
);
|
|
48
|
+
console.log(result); // Array of results for each ID
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```ts With Option
|
|
52
|
+
// Use KEEPREF option to keep consumer group references
|
|
53
|
+
const result = await redis.xdelex(
|
|
54
|
+
"mystream",
|
|
55
|
+
"KEEPREF",
|
|
56
|
+
"1638360173533-0",
|
|
57
|
+
"1638360173533-1"
|
|
58
|
+
);
|
|
59
|
+
console.log(result); // Array of results for each ID
|
|
60
|
+
|
|
61
|
+
// Use DELREF option to delete consumer group references
|
|
62
|
+
const result2 = await redis.xdelex(
|
|
63
|
+
"mystream",
|
|
64
|
+
"DELREF",
|
|
65
|
+
"1638360173533-0"
|
|
66
|
+
);
|
|
67
|
+
console.log(result2); // Array of results for each ID
|
|
68
|
+
|
|
69
|
+
// Use ACKED option to only acknowledge (don't delete)
|
|
70
|
+
const result3 = await redis.xdelex(
|
|
71
|
+
"mystream",
|
|
72
|
+
"ACKED",
|
|
73
|
+
"1638360173533-0"
|
|
74
|
+
);
|
|
75
|
+
console.log(result3); // Array of results for each ID
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```ts With Stream Processing
|
|
79
|
+
// Add entries to stream
|
|
80
|
+
await redis.xadd("events", "*", { type: "login", user: "john" });
|
|
81
|
+
await redis.xadd("events", "*", { type: "logout", user: "john" });
|
|
82
|
+
|
|
83
|
+
// Read entries
|
|
84
|
+
const entries = await redis.xrange("events", "-", "+");
|
|
85
|
+
console.log(entries);
|
|
86
|
+
|
|
87
|
+
// Delete specific entries
|
|
88
|
+
const deleted = await redis.xdelex(
|
|
89
|
+
"events",
|
|
90
|
+
entries[0][0], // First entry ID
|
|
91
|
+
entries[1][0] // Second entry ID
|
|
92
|
+
);
|
|
93
|
+
console.log(`Results: ${deleted}`); // Array of results for each ID
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```ts Cleanup Old Entries
|
|
97
|
+
// Get entries older than a certain timestamp
|
|
98
|
+
const oldEntries = await redis.xrange("logs", "-", "1638360000000-0");
|
|
99
|
+
|
|
100
|
+
// Delete old entries
|
|
101
|
+
if (oldEntries.length > 0) {
|
|
102
|
+
const ids = oldEntries.map(entry => entry[0]);
|
|
103
|
+
const deleted = await redis.xdelex("logs", ...ids);
|
|
104
|
+
console.log(`Results: ${deleted}`); // Array of results for each ID
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
</RequestExample>
|
|
108
|
+
|
|
109
|
+
## Use Cases
|
|
110
|
+
|
|
111
|
+
- **Stream Cleanup**: Remove processed or expired stream entries
|
|
112
|
+
- **Data Retention**: Implement custom retention policies
|
|
113
|
+
- **Error Handling**: Delete corrupted or invalid stream entries
|
|
114
|
+
- **Memory Management**: Clean up streams to free memory
|
|
115
|
+
|
|
116
|
+
<Note>
|
|
117
|
+
This command is available in Redis 8.2.0 and later. It provides extended functionality compared to the standard XDEL command.
|
|
118
|
+
</Note>
|
|
119
|
+
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XGROUP
|
|
3
|
+
description: Manage consumer groups for Redis streams.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
<ParamField body="subcommand" type="object" required>
|
|
13
|
+
The XGROUP subcommand and its parameters. Can be one of:
|
|
14
|
+
|
|
15
|
+
<Expandable title="CREATE">
|
|
16
|
+
<ParamField body="type" type="'CREATE'" required>
|
|
17
|
+
Create a new consumer group.
|
|
18
|
+
</ParamField>
|
|
19
|
+
<ParamField body="group" type="string" required>
|
|
20
|
+
The consumer group name.
|
|
21
|
+
</ParamField>
|
|
22
|
+
<ParamField body="id" type="string | '$'" required>
|
|
23
|
+
The stream entry ID to start consuming from. Use '$' to start from the end.
|
|
24
|
+
</ParamField>
|
|
25
|
+
<ParamField body="options">
|
|
26
|
+
<Expandable title="options">
|
|
27
|
+
<ParamField body="MKSTREAM" type="boolean">
|
|
28
|
+
Create the stream if it doesn't exist.
|
|
29
|
+
</ParamField>
|
|
30
|
+
<ParamField body="ENTRIESREAD" type="number">
|
|
31
|
+
Set the number of entries read by the group.
|
|
32
|
+
</ParamField>
|
|
33
|
+
</Expandable>
|
|
34
|
+
</ParamField>
|
|
35
|
+
</Expandable>
|
|
36
|
+
|
|
37
|
+
<Expandable title="CREATECONSUMER">
|
|
38
|
+
<ParamField body="type" type="'CREATECONSUMER'" required>
|
|
39
|
+
Create a new consumer in the group.
|
|
40
|
+
</ParamField>
|
|
41
|
+
<ParamField body="group" type="string" required>
|
|
42
|
+
The consumer group name.
|
|
43
|
+
</ParamField>
|
|
44
|
+
<ParamField body="consumer" type="string" required>
|
|
45
|
+
The consumer name to create.
|
|
46
|
+
</ParamField>
|
|
47
|
+
</Expandable>
|
|
48
|
+
|
|
49
|
+
<Expandable title="DELCONSUMER">
|
|
50
|
+
<ParamField body="type" type="'DELCONSUMER'" required>
|
|
51
|
+
Delete a consumer from the group.
|
|
52
|
+
</ParamField>
|
|
53
|
+
<ParamField body="group" type="string" required>
|
|
54
|
+
The consumer group name.
|
|
55
|
+
</ParamField>
|
|
56
|
+
<ParamField body="consumer" type="string" required>
|
|
57
|
+
The consumer name to delete.
|
|
58
|
+
</ParamField>
|
|
59
|
+
</Expandable>
|
|
60
|
+
|
|
61
|
+
<Expandable title="DESTROY">
|
|
62
|
+
<ParamField body="type" type="'DESTROY'" required>
|
|
63
|
+
Delete the entire consumer group.
|
|
64
|
+
</ParamField>
|
|
65
|
+
<ParamField body="group" type="string" required>
|
|
66
|
+
The consumer group name to destroy.
|
|
67
|
+
</ParamField>
|
|
68
|
+
</Expandable>
|
|
69
|
+
|
|
70
|
+
<Expandable title="SETID">
|
|
71
|
+
<ParamField body="type" type="'SETID'" required>
|
|
72
|
+
Set the last delivered ID for the group.
|
|
73
|
+
</ParamField>
|
|
74
|
+
<ParamField body="group" type="string" required>
|
|
75
|
+
The consumer group name.
|
|
76
|
+
</ParamField>
|
|
77
|
+
<ParamField body="id" type="string | '$'" required>
|
|
78
|
+
The stream entry ID to set as the last delivered ID.
|
|
79
|
+
</ParamField>
|
|
80
|
+
<ParamField body="options">
|
|
81
|
+
<Expandable title="options">
|
|
82
|
+
<ParamField body="ENTRIESREAD" type="number">
|
|
83
|
+
Set the number of entries read by the group.
|
|
84
|
+
</ParamField>
|
|
85
|
+
</Expandable>
|
|
86
|
+
</ParamField>
|
|
87
|
+
</Expandable>
|
|
88
|
+
</ParamField>
|
|
89
|
+
|
|
90
|
+
## Response
|
|
91
|
+
|
|
92
|
+
<ResponseField>
|
|
93
|
+
The return type depends on the subcommand:
|
|
94
|
+
- CREATE: Returns "OK" string
|
|
95
|
+
- CREATECONSUMER: Returns 1 if created, 0 if already exists
|
|
96
|
+
- DELCONSUMER: Returns the number of pending messages the consumer had
|
|
97
|
+
- DESTROY: Returns 1 if destroyed, 0 if group didn't exist
|
|
98
|
+
- SETID: Returns "OK" string
|
|
99
|
+
</ResponseField>
|
|
100
|
+
|
|
101
|
+
<RequestExample>
|
|
102
|
+
```ts Create group
|
|
103
|
+
const result = await redis.xgroup("mystream", {
|
|
104
|
+
type: "CREATE",
|
|
105
|
+
group: "mygroup",
|
|
106
|
+
id: "$",
|
|
107
|
+
options: { MKSTREAM: true }
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```ts Create consumer
|
|
112
|
+
const result = await redis.xgroup("mystream", {
|
|
113
|
+
type: "CREATECONSUMER",
|
|
114
|
+
group: "mygroup",
|
|
115
|
+
consumer: "consumer1"
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```ts Delete consumer
|
|
120
|
+
const result = await redis.xgroup("mystream", {
|
|
121
|
+
type: "DELCONSUMER",
|
|
122
|
+
group: "mygroup",
|
|
123
|
+
consumer: "consumer1"
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```ts Set group ID
|
|
128
|
+
const result = await redis.xgroup("mystream", {
|
|
129
|
+
type: "SETID",
|
|
130
|
+
group: "mygroup",
|
|
131
|
+
id: "0-0"
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```ts Destroy group
|
|
136
|
+
const result = await redis.xgroup("mystream", {
|
|
137
|
+
type: "DESTROY",
|
|
138
|
+
group: "mygroup"
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
</RequestExample>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XINFO
|
|
3
|
+
description: Returns information about streams, consumer groups, and consumers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
<ParamField body="options" type="object" required>
|
|
13
|
+
The XINFO subcommand options. Can be one of:
|
|
14
|
+
<Expandable title="GROUPS">
|
|
15
|
+
<ParamField body="type" type="'GROUPS'" required>
|
|
16
|
+
List all consumer groups for the stream.
|
|
17
|
+
</ParamField>
|
|
18
|
+
</Expandable>
|
|
19
|
+
|
|
20
|
+
<Expandable title="CONSUMERS">
|
|
21
|
+
<ParamField body="type" type="'CONSUMERS'" required>
|
|
22
|
+
List all consumers in a consumer group.
|
|
23
|
+
</ParamField>
|
|
24
|
+
<ParamField body="group" type="string" required>
|
|
25
|
+
The consumer group name.
|
|
26
|
+
</ParamField>
|
|
27
|
+
</Expandable>
|
|
28
|
+
</ParamField>
|
|
29
|
+
|
|
30
|
+
## Response
|
|
31
|
+
|
|
32
|
+
<ResponseField>
|
|
33
|
+
The return type depends on the subcommand:
|
|
34
|
+
- GROUPS: Returns an array of consumer group information
|
|
35
|
+
- CONSUMERS: Returns an array of consumer information
|
|
36
|
+
</ResponseField>
|
|
37
|
+
|
|
38
|
+
<RequestExample>
|
|
39
|
+
```ts List groups
|
|
40
|
+
const result = await redis.xinfo("mystream", {
|
|
41
|
+
type: "GROUPS"
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```ts List consumers
|
|
46
|
+
const result = await redis.xinfo("mystream", {
|
|
47
|
+
type: "CONSUMERS",
|
|
48
|
+
group: "mygroup"
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
</RequestExample>
|
|
52
|
+
|
|
53
|
+
<ResponseExample>
|
|
54
|
+
```ts
|
|
55
|
+
// GROUPS response
|
|
56
|
+
[
|
|
57
|
+
{
|
|
58
|
+
name: "mygroup",
|
|
59
|
+
consumers: 2,
|
|
60
|
+
pending: 1,
|
|
61
|
+
"last-delivered-id": "1638360173533-2",
|
|
62
|
+
"entries-read": 3,
|
|
63
|
+
lag: 2
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
// CONSUMERS response
|
|
68
|
+
[
|
|
69
|
+
{
|
|
70
|
+
name: "consumer1",
|
|
71
|
+
pending: 1,
|
|
72
|
+
idle: 15000,
|
|
73
|
+
"inactive": 15000
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
```
|
|
77
|
+
</ResponseExample>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XLEN
|
|
3
|
+
description: Returns the number of entries inside a stream.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
## Response
|
|
13
|
+
|
|
14
|
+
<ResponseField type="number">
|
|
15
|
+
The number of entries in the stream. Returns 0 if the stream does not exist.
|
|
16
|
+
</ResponseField>
|
|
17
|
+
|
|
18
|
+
<RequestExample>
|
|
19
|
+
```ts Get stream length
|
|
20
|
+
const result = await redis.xlen("mystream");
|
|
21
|
+
```
|
|
22
|
+
</RequestExample>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XPENDING
|
|
3
|
+
description: Returns information about pending messages in a stream consumer group.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
<ParamField body="group" type="string" required>
|
|
13
|
+
The consumer group name.
|
|
14
|
+
</ParamField>
|
|
15
|
+
|
|
16
|
+
<ParamField body="start" type="string" required>
|
|
17
|
+
The minimum pending ID to return. Use "-" for the first available ID.
|
|
18
|
+
</ParamField>
|
|
19
|
+
|
|
20
|
+
<ParamField body="end" type="string" required>
|
|
21
|
+
The maximum pending ID to return. Use "+" for the last available ID.
|
|
22
|
+
</ParamField>
|
|
23
|
+
|
|
24
|
+
<ParamField body="count" type="number" required>
|
|
25
|
+
The maximum number of pending messages to return.
|
|
26
|
+
</ParamField>
|
|
27
|
+
|
|
28
|
+
<ParamField body="options">
|
|
29
|
+
<Expandable title="properties">
|
|
30
|
+
<ParamField body="idleTime" type="number">
|
|
31
|
+
Filter by minimum idle time in milliseconds.
|
|
32
|
+
</ParamField>
|
|
33
|
+
<ParamField body="consumer" type="string">
|
|
34
|
+
Filter results by a specific consumer.
|
|
35
|
+
</ParamField>
|
|
36
|
+
</Expandable>
|
|
37
|
+
</ParamField>
|
|
38
|
+
|
|
39
|
+
## Response
|
|
40
|
+
|
|
41
|
+
<ResponseField>
|
|
42
|
+
Returns an array of pending message details.
|
|
43
|
+
</ResponseField>
|
|
44
|
+
|
|
45
|
+
<RequestExample>
|
|
46
|
+
```ts Summary
|
|
47
|
+
const result = await redis.xpending("mystream", "mygroup", "-", "+", 10);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```ts With idle time filter
|
|
51
|
+
const result = await redis.xpending("mystream", "mygroup", "-", "+", 5, {
|
|
52
|
+
idleTime: 10000
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```ts Specific consumer filter
|
|
57
|
+
const result = await redis.xpending("mystream", "mygroup", "-", "+", 5, {
|
|
58
|
+
consumer: "consumer1"
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
</RequestExample>
|
|
62
|
+
|
|
63
|
+
<ResponseExample>
|
|
64
|
+
```ts
|
|
65
|
+
[
|
|
66
|
+
2, // total pending count
|
|
67
|
+
"1638360173533-0", // smallest pending ID
|
|
68
|
+
"1638360173533-1", // greatest pending ID
|
|
69
|
+
[
|
|
70
|
+
["consumer1", "1"], // consumer and their pending count
|
|
71
|
+
["consumer2", "1"]
|
|
72
|
+
]
|
|
73
|
+
]
|
|
74
|
+
```
|
|
75
|
+
</ResponseExample>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XRANGE
|
|
3
|
+
description: Returns stream entries matching a given range of IDs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Arguments
|
|
7
|
+
|
|
8
|
+
<ParamField body="key" type="string" required>
|
|
9
|
+
The key to of the stream.
|
|
10
|
+
</ParamField>
|
|
11
|
+
|
|
12
|
+
<ParamField body="start" type="string" required>
|
|
13
|
+
The stream entry ID to start from.
|
|
14
|
+
</ParamField>
|
|
15
|
+
|
|
16
|
+
<ParamField body="end" type="string" required>
|
|
17
|
+
The stream entry ID to end at.
|
|
18
|
+
</ParamField>
|
|
19
|
+
|
|
20
|
+
<ParamField body="count" type="number">
|
|
21
|
+
The maximum number of entries to return.
|
|
22
|
+
</ParamField>
|
|
23
|
+
|
|
24
|
+
## Response
|
|
25
|
+
|
|
26
|
+
<ResponseField type="Record<streamId, Record<field, value>>">
|
|
27
|
+
An object of stream entries, keyed by their stream ID
|
|
28
|
+
</ResponseField>
|
|
29
|
+
|
|
30
|
+
<RequestExample>
|
|
31
|
+
```ts All entries
|
|
32
|
+
const result = await redis.xrange("mystream", "-", "+");
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```ts Range with specific IDs
|
|
36
|
+
const result = await redis.xrange("mystream", "1548149259438-0", "1548149259438-5");
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```ts Limited count
|
|
40
|
+
const result = await redis.xrange("mystream", "-", "+", 10);
|
|
41
|
+
```
|
|
42
|
+
</RequestExample>
|
|
43
|
+
|
|
44
|
+
<ResponseExample>
|
|
45
|
+
```ts
|
|
46
|
+
{
|
|
47
|
+
"1548149259438-0": {
|
|
48
|
+
"field1": "value1",
|
|
49
|
+
"field2": "value2"
|
|
50
|
+
},
|
|
51
|
+
"1548149259438-1": {
|
|
52
|
+
"field1": "value3",
|
|
53
|
+
"field2": "value4"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
</ResponseExample>
|
|
58
|
+
|
|
59
|
+
|