github redis/node-redis redis@6.2.0

4 hours ago

6.2.0

✨ Highlights

Cluster commands now follow the server's request/response policies. node-redis reads each command's routing policy from the server's COMMAND metadata and routes and aggregates accordingly, so the cluster client behaves much more like a single server. Multi-key commands that span hash slots — MGET, MSET, DEL, EXISTS, TOUCH, UNLINK — are transparently split per slot and their replies reassembled in caller order, so cross-slot calls that previously failed with CROSSSLOT now just work. Fan-out commands such as KEYS, DBSIZE, FLUSHALL, PING, WAIT, SCRIPT EXISTS and CONFIG SET run across every shard (or every node) and their replies are aggregated per the server's policy, SCAN walks the whole cluster behind a per-client virtual cursor, and RANDOMKEY / FT.CURSOR get correct cluster-aware routing. Replica read-scaling was also aligned with the server flags, so read-only keyless commands (DBSIZE, KEYS, SCAN, RANDOMKEY, and the RediSearch / time-series reads) can be served from replicas again.

⚠️ Behavior change for the raw sendCommand path: a table-recognized command sent raw — e.g. cluster.sendCommand(['DBSIZE']) — now follows its policy (fan-out and aggregate) instead of hitting a single node. Callers who relied on raw commands for per-node operations should target a specific node with cluster.nodeClient(node).sendCommand(...).

This release also brings a broad wave of new command coverage across the client and modules. The time-series package gains the most: new TS.NRANGE/TS.NREVRANGE multi-key pivot commands, a TS.READ cursor reader, TS.QUERYLABELS, EXCLUDEEMPTY on MRANGE/MREVRANGE, and multi-aggregator support. RediSearch adds FT.ALIASLIST, a COLLECT reducer for FT.AGGREGATE, HNSW RERANK, timeout warnings on the FT.SEARCH family, and the full set of stemmer languages. The core client adds SUNIONCARD/SDIFFCARD, LMOVEM/BLMOVEM, ZREVRANK WITHSCORE, COMMAND DOCS, and XREAD MAXCOUNT/MAXSIZE. A large batch of correctness fixes lands for zero-valued optional arguments (LIMIT 0, DB 0, SAMPLES 0, ENTRIESREAD 0, IDLETIME/FREQ 0, ENTRIESADDED 0) that were previously dropped from the wire, alongside several cluster and sentinel connection-lifecycle fixes.

The new HIMPORT command family (managed fieldset lifecycle) ships as experimental — see the warning below.

🚀 New Features

  • feat(client): request/response policy routing for cluster commands (multi_shard split, fan-out aggregation, special SCAN/RANDOMKEY/FT.CURSOR) (#2996) — @nkaradzhov
  • feat: add COMMAND DOCS support (#3362) — @Hashim1999164
  • feat(client): add LMOVEM and BLMOVEM commands (#3340) — @nkaradzhov
  • feat(client): add SUNIONCARD and SDIFFCARD set-cardinality commands (#3336) — @nkaradzhov
  • feat(client): add zRevRankWithScore (#3279) — @raashish1601
  • feat(xread): add MAXCOUNT / MAXSIZE options (#3335) — @nkaradzhov
  • feat(search): expose timeout warnings on the FT.SEARCH family (#3338) — @nkaradzhov
  • feat(search): add missing RediSearch stemmer languages (#3350) — @nkaradzhov
  • feat(search): add FT.ALIASLIST (#3351) — @nkaradzhov
  • feat(search): add RERANK parameter for HNSW vector fields (#3356) — @nkaradzhov
  • feat(search): add COLLECT reducer to FT.AGGREGATE (#3310) — @nkaradzhov
  • feat(time-series): add TS.NRANGE / TS.NREVRANGE multi-key pivot commands (#3337) — @nkaradzhov
  • feat(time-series): support multiple aggregators per key in TS.NRANGE / TS.NREVRANGE (#3360) — @nkaradzhov
  • feat(time-series): add TS.QUERYLABELS (LABELS and VALUES forms) (#3354) — @nkaradzhov
  • feat(time-series): add EXCLUDEEMPTY to TS.MRANGE / TS.MREVRANGE (#3352) — @nkaradzhov
  • feat(time-series): add TS.READ cursor-read command (#3322) — @nkaradzhov
  • feat(json): add reviver support to GET, MGET, and ARRPOP (#3205) — @JeanSamGirard

⚠️ Experimental

  • feat(client): add HIMPORT command family with managed fieldset lifecycle (#3381) — @nkaradzhov. The HIMPORT family and its FieldsetRegistry/PreparedFieldsets API are experimental and unstable; the surface may change or be removed in a future release. Do not depend on it in production.

🐛 Bug Fixes

  • fix(cluster): reject commands before the cluster topology is ready (#3321) — @GiHoon1123
  • fix(cluster): rebind abort/timeout listeners when a command moves to another queue (#3367) — @GiHoon1123
  • fix(cluster): make extractAllCommands drain the write queue (#3364) — @GiHoon1123
  • fix(sentinel): reject connect() instead of hanging when the resolved master is unreachable (#3331) — @GiHoon1123
  • fix(client): include the acquire-timeout duration in the pool timeout error message (#3382) — @Piyush0049
  • fix(client): reject the in-flight connect attempt when the socket dies during the initiator (#3374) — @nkaradzhov
  • fix(client): correct DoublyLinkedList head removal (#3320) — @abhijeet117
  • fix(client): XADD/XTRIM with LIMIT 0 must emit the argument (#3342) — @Develop-KIM
  • fix(client): XGROUP CREATE/SETID with ENTRIESREAD 0 must emit the argument (#3333) — @Develop-KIM
  • fix(client): XSETID with ENTRIESADDED 0 must emit the argument (#3324) — @spokodev
  • fix(client): MEMORY USAGE must emit SAMPLES when 0 (#3328) — @Develop-KIM
  • fix(client): RESTORE with IDLETIME/FREQ 0 must emit the argument (#3323) — @spokodev
  • fix(client): GETEX PXAT with a Date must encode milliseconds (#3317) — @spokodev
  • fix(client): COPY with DB 0 must emit the DB argument (#3318) — @spokodev
  • fix(search): preserve zero FT.CREATE scores (#3355) — @alencristen
  • fix: hScanValuesIterator now yields values instead of field names (#3344) — @winklemad

🧰 Maintenance

  • ci(release): skip the throwaway workspace update during the staggered release (#3384) — @nkaradzhov
  • ci: fix the release-drafter Maintenance category key (#3358) — @nkaradzhov
  • ci(documentation): cap GITHUB_TOKEN to contents: read (#3291) — @arpitjain099
  • chore(tests): bump the default docker test image to 8.10 (#3319, #3348, #3383) — @nkaradzhov
  • refactor(test-utils): single source for the default docker test image config (#3349) — @nkaradzhov
  • test: run the client command specs against an external Redis Enterprise database (#3341) — @kiryazovi-redis
  • test(scenario): tolerate at-least-once duplicate delivery during sharded pub/sub handoff (#3345) — @kiryazovi-redis
  • test(search): add non-English language coverage for FT.SEARCH (#3339) — @nkaradzhov
  • test(client): add a message-assertion test for XCLAIM JUSTID (#3376) — @Piyush0049
  • test/fix: stabilize the flaky cluster PubSub listener-move test (#3347, #3357) — @nkaradzhov
  • fix(client): stabilize the flaky LATENCY LATEST test (#3326) — @nkaradzhov
  • fix: remove dangling agent symlinks that break checkout (#3334) — @nkaradzhov
  • docs: add a CommonJS basic example to the README (#3359) — @Hashim1999164
  • docs(cluster): document that rootNodes config is not inherited by node connections (#3327) — @nkaradzhov
  • docs: update the end event description to reference close() and destroy() (#3332) — @Wnayar
  • docs(contributing): document the Docker Desktop host-networking requirement for tests on macOS/Windows (#3330) — @nkaradzhov
  • chore(docs): update the security email (#3379) — @nkaradzhov
  • chore: add agent skills and tooling configs (#3316) — @nkaradzhov
  • chore(skills): emit maintainer comments without blockquote markers (#3373) — @nkaradzhov
  • docs(skills): improve the implement-command guidance (#3353) — @nkaradzhov
  • chore: bump the metrics exporter (#3375) — @bobymicroby
  • chore(deps): bump jws (#3372), on-headers / express-session (#3371), uuid / nyc (#3370), esbuild / tsx (#3309) — @dependabot

New Contributors

Full Changelog: https://github.com/redis/node-redis/compare/redis@6.1.0...redis@6.2.0

Don't miss a new node-redis release

NewReleases is sending notifications on new releases.