Repository navigation
Add arrays API - #3745
Add arrays API#3745
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
| * @see <a href="https://redis.io/docs/latest/commands/argrep/">Redis Documentation: ARGREP</a> | ||
| */ | ||
| @Experimental | ||
| Flux<Long> argrep(K key, ArGrepArgs grepArgs); |
There was a problem hiding this comment.
Actually its not. It supports + - syntax:
ARGREP myarray - + EXACT foo AND EXACT bar
This means we can treat it like optional and default to + - , which essentially means the full range.
| } | ||
|
|
||
| @Override | ||
| public RedisFuture<List<IndexedValue<V>>> argrepWithValues(K key, ArGrepArgs grepArgs) { |
There was a problem hiding this comment.
Actually its not. It supports + - syntax:
ARGREP myarray - + EXACT foo AND EXACT bar
This means we can treat it like optional and default to + - , which essentially means the full range.
| * | ||
| * @return {@code this}. | ||
| */ | ||
| public ArGrepArgs withValues() { |
| * @see <a href="https://redis.io/docs/latest/commands/argrep/">Redis Documentation: ARGREP</a> | ||
| */ | ||
| @Experimental | ||
| Flux<IndexedValue<V>> argrepWithValues(K key, ArGrepArgs grepArgs); |
There was a problem hiding this comment.
Actually its not. It supports + - syntax:
ARGREP myarray - + EXACT foo AND EXACT bar
This means we can treat it like optional and default to + - , which essentially means the full range.
| * @see <a href="https://redis.io/docs/latest/commands/arlastitems/">Redis Documentation: ARLASTITEMS</a> | ||
| */ | ||
| @Experimental | ||
| Executions<List<V>> arlastitemsRev(K key, long count); |
There was a problem hiding this comment.
or
Executions<List<V>> arlastitems(K key, long count. boolean rev);
| * @since 7.6 | ||
| * @see <a href="https://redis.io/docs/latest/commands/arop/">Redis Documentation: AROP</a> | ||
| */ | ||
| public enum ArCountType { |
| * @see <a href="https://redis.io/docs/latest/commands/arop/">Redis Documentation: AROP</a> | ||
| */ | ||
| @Experimental | ||
| Mono<Long> aropCount(K key, Range<Long> range, ArCountType operation); |
There was a problem hiding this comment.
better separate Bitwise ops and USED
| * @see <a href="https://redis.io/docs/latest/commands/arop/">Redis Documentation: AROP</a> | ||
| */ | ||
| @Experimental | ||
| Mono<Long> aropMatch(K key, Range<Long> range, V matchValue); |
| * @see <a href="https://redis.io/docs/latest/commands/arscan/">Redis Documentation: ARSCAN</a> | ||
| */ | ||
| @Experimental | ||
| Flux<IndexedValue<V>> arscan(K key, ArScanArgs scanArgs); |
There was a problem hiding this comment.
start/end mandatory
ArScanArgs can be dropped
| return directorySize; | ||
| } | ||
|
|
||
| public void setDirectorySize(Long directorySize) { |
| return denseSlices; | ||
| } | ||
|
|
||
| public void setDenseSlices(Long denseSlices) { |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3b8492c. Configure here.
| subscriber.onNext(output, new IndexedValue<>(currentIndex, value)); | ||
| hasIndex = false; | ||
| } | ||
| } |
There was a problem hiding this comment.
IndexedValueListOutput silently drops bulk-string indices
Medium Severity
IndexedValueListOutput.set(ByteBuffer) silently discards any buffer received when hasIndex is false. The index is only recognized via set(long). If the server returns indices as bulk strings (e.g. under RESP2), set(ByteBuffer) is called for both index and value, hasIndex never becomes true, and the entire response is silently dropped — producing an empty list for ARSCAN and ARGREP WITHVALUES.
Reviewed by Cursor Bugbot for commit 3b8492c. Configure here.


Make sure that:
mvn formatter:formattarget. Don’t submit any formatting related changes.Note
Medium Risk
Introduces a new command family and extends core command/type/keyword enums, which can affect command dispatch and protocol parsing across all clients despite being additive and marked experimental.
Overview
Adds experimental Redis Arrays support end-to-end: new
RedisArray*CommandsAPIs (sync/async/reactive), cluster node-selection variants, and Kotlin coroutines bindings.Implements command construction via new
RedisArrayCommandBuilderand wires it intoAbstractRedisAsyncCommands/AbstractRedisReactiveCommands, plus adds parsers/outputs for array-specific responses (ArrayInfo*Parser,IndexedValueListOutput) and new array-related model/arg types (e.g.,ArGrepArgs,ArrayInfo,IndexedValue).Extends protocol enums to recognize the new commands/keywords (
CommandType,CommandKeyword) and marks relevant commands as read-only inReadOnlyCommands; includes unit tests for command encoding and a cluster integration test scaffold.Reviewed by Cursor Bugbot for commit ccccb25. Bugbot is set up for automated code reviews on this repo. Configure here.