Skip to content

feat(client): add Redis 8.8 array commands#3285

Merged
nkaradzhov merged 2 commits into
redis:masterfrom
nkaradzhov:arrays
May 20, 2026
Merged

feat(client): add Redis 8.8 array commands#3285
nkaradzhov merged 2 commits into
redis:masterfrom
nkaradzhov:arrays

Conversation

@nkaradzhov
Copy link
Copy Markdown
Collaborator

@nkaradzhov nkaradzhov commented May 19, 2026

Adds support for the 19-command AR* family introduced in Redis 8.8: ARSET, ARGET, ARGETRANGE, ARMSET, ARMGET, ARLEN, ARCOUNT, ARNEXT, ARINFO, ARDEL, ARDELRANGE, ARSCAN, ARGREP (+WITHVALUES), ARINSERT, ARRING, ARSEEK, ARLASTITEMS, AROP.

Notable design choices:

  • All index inputs accept number | string so callers can pass decimal strings for indices above Number.MAX_SAFE_INTEGER (the server's index space is uint64). Output-side precision is delegated to the existing codebase-wide escape hatch: client.withTypeMapping({ [RESP_TYPES.NUMBER]: String }), with @remarks pointing at it on every AR* command that may return a large index.
  • ARGREP accepts the open-ended bounds '-' and '+' in addition to numeric indices, in any combination.

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Note

Medium Risk
Adds a large new surface area of Redis commands and associated typings/transformers, which could introduce API/typing mismatches or reply-shape bugs despite being largely additive and version-gated.

Overview
Adds client support for the Redis 8.8 AR* “array” command family, wiring new command builders into packages/client/lib/commands/index.ts and exposing them via the public client API (e.g. client.arSet, client.arGrep, client.arOp).

Introduces argument/option typing for array indices (supporting number | string, plus '-'/'+' bounds for ARGREP) and exports new constants (AR_PREDICATE_TYPES, AR_PREDICATE_COMBINATORS, AR_OPERATIONS) from both lib/commands and the package entrypoint.

Adds extensive unit/integration tests for the new commands (including edge cases like sparse arrays, cursor behavior, modifier ordering, and server-side error validation), gated to Redis versions >= 8.8.

Reviewed by Cursor Bugbot for commit a2166df. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds support for the 19-command AR* family introduced in Redis 8.8:
ARSET, ARGET, ARGETRANGE, ARMSET, ARMGET, ARLEN, ARCOUNT, ARNEXT,
ARINFO, ARDEL, ARDELRANGE, ARSCAN, ARGREP (+WITHVALUES), ARINSERT,
ARRING, ARSEEK, ARLASTITEMS, AROP.

Notable design choices:
- All index inputs accept `number | string` so callers can pass decimal
  strings for indices above `Number.MAX_SAFE_INTEGER` (the server's
  index space is uint64). Output-side precision is delegated to the
  existing codebase-wide escape hatch:
  `client.withTypeMapping({ [RESP_TYPES.NUMBER]: String })`, with
  @remarks pointing at it on every AR* command that may return a large
  index.
- ARGREP accepts the open-ended bounds `'-'` and `'+'` in addition to
  numeric indices, in any combination.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit e3450bc. Configure here.

Comment thread packages/client/lib/commands/ARSET.ts Outdated
Comment thread packages/client/lib/commands/ARSET.ts Outdated
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@bobymicroby bobymicroby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nkaradzhov nkaradzhov merged commit ca5695a into redis:master May 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants