K - Key type.V - Value type.public interface RedisArrayAsyncCommands<K,V>
Arrays are a Redis data type for sparse, indexed collections that support efficient element access, range operations, pattern matching, and aggregation.
| Modifier and Type | Method and Description |
|---|---|
RedisFuture<Long> |
arcount(K key)
Get the count of populated (non-empty) slots in the array.
|
RedisFuture<Long> |
ardel(K key,
long... indices)
Delete elements at the given indices.
|
RedisFuture<Long> |
ardel(K key,
long index)
Delete a single element at the given index.
|
RedisFuture<Long> |
ardelrange(K key,
ArrayIndexRange... ranges)
Delete elements in the given ranges.
|
RedisFuture<Long> |
ardelrange(K key,
long start,
long end)
Delete elements in the given range (inclusive).
|
RedisFuture<V> |
arget(K key,
long index)
Get the value at the given index in the array stored at
key. |
RedisFuture<List<V>> |
argetrange(K key,
long start,
long end)
Get all values in a range, including
null for empty slots. |
RedisFuture<List<Long>> |
argrep(K key,
ArGrepArgs grepArgs)
Search for elements matching predicates, returning matching indices.
|
RedisFuture<List<IndexedValue<V>>> |
argrepWithValues(K key,
ArGrepArgs grepArgs)
Search for elements matching predicates, returning index/value pairs.
|
RedisFuture<ArrayInfo> |
arinfo(K key)
Get metadata about the array.
|
RedisFuture<ArrayInfoFull> |
arinfoFull(K key)
Get extended metadata about the array (including per-slice stats).
|
RedisFuture<Long> |
arinsert(K key,
V... values)
Insert one or more values at the next available index.
|
RedisFuture<Long> |
arinsert(K key,
V value)
Insert a single value at the next available index.
|
RedisFuture<List<V>> |
arlastitems(K key,
long count)
Get the last N items in insertion order.
|
RedisFuture<List<V>> |
arlastitems(K key,
long count,
boolean rev)
Get the last N items, optionally in reverse order.
|
RedisFuture<Long> |
arlen(K key)
Get the logical length of the array (max index + 1).
|
RedisFuture<List<V>> |
armget(K key,
long... indices)
Get the values at multiple indices in the array stored at
key. |
RedisFuture<Long> |
armset(K key,
Map<Long,V> indexValueMap)
Set multiple index-value pairs in the array stored at
key. |
RedisFuture<Long> |
arnext(K key)
Get the next insert index for the array.
|
RedisFuture<V> |
aropAggregate(K key,
long start,
long end,
ArAggregateType operation)
Perform an aggregate operation (SUM, MIN, MAX) over elements in a range.
|
RedisFuture<Long> |
aropBitwise(K key,
long start,
long end,
ArBitwiseType operation)
Perform a bitwise operation (AND, OR, XOR) over elements in a range.
|
RedisFuture<Long> |
aropCount(K key,
long start,
long end)
Count the number of non-empty (populated) elements in a range (AROP USED).
|
RedisFuture<Long> |
aropCount(K key,
long start,
long end,
V matchValue)
Count occurrences of a value in a range (AROP MATCH).
|
RedisFuture<Long> |
arring(K key,
long size,
V... values)
Insert values in a ring buffer fashion, wrapping around when the size is exceeded.
|
RedisFuture<Long> |
arring(K key,
long size,
V value)
Insert a single value in a ring buffer fashion, wrapping around when the size is exceeded.
|
RedisFuture<List<IndexedValue<V>>> |
arscan(K key,
long start,
long end)
Scan populated entries in a range, returning index/value pairs.
|
RedisFuture<List<IndexedValue<V>>> |
arscan(K key,
long start,
long end,
long limit)
Scan populated entries in a range with a limit, returning index/value pairs.
|
RedisFuture<Long> |
arseek(K key,
long index)
Set the insert cursor to a specific index.
|
RedisFuture<Long> |
arset(K key,
long index,
V... values)
Set one or more contiguous values starting at the given index in the array stored at
key. |
RedisFuture<Long> |
arset(K key,
long index,
V value)
Set a value at the given index in the array stored at
key. |
@Experimental RedisFuture<Long> arset(K key, long index, V value)
key.key - the key of the array.index - the index to set.value - the value to store.@Experimental RedisFuture<Long> arset(K key, long index, V... values)
key.key - the key of the array.index - the starting index.values - the values to store at consecutive indices.@Experimental RedisFuture<Long> armset(K key, Map<Long,V> indexValueMap)
key.key - the key of the array.indexValueMap - map of index to value pairs.@Experimental RedisFuture<V> arget(K key, long index)
key.key - the key of the array.index - the index to get.null if the index is empty or the key does not exist.@Experimental RedisFuture<List<V>> armget(K key, long... indices)
key.key - the key of the array.indices - the indices to get.null for empty slots).@Experimental RedisFuture<Long> ardel(K key, long index)
This single-index overload provides boolean-like semantics ("was this element there?"), distinct from the multi-index varargs form which returns a count.
key - the key of the array.index - the index to delete.@Experimental RedisFuture<Long> ardel(K key, long... indices)
key - the key of the array.indices - the indices to delete.@Experimental RedisFuture<Long> ardelrange(K key, long start, long end)
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).@Experimental RedisFuture<Long> ardelrange(K key, ArrayIndexRange... ranges)
key - the key of the array.ranges - one or more ranges to delete.@Experimental RedisFuture<Long> arlen(K key)
key - the key of the array.@Experimental RedisFuture<Long> arcount(K key)
key - the key of the array.@Experimental RedisFuture<List<V>> argetrange(K key, long start, long end)
null for empty slots.
The range must not exceed 1,000,000 items.
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).null for empty slots).@Experimental RedisFuture<Long> arnext(K key)
key - the key of the array.null if the cursor is exhausted.@Experimental RedisFuture<List<V>> arlastitems(K key, long count)
key - the key of the array.count - the number of items to return.@Experimental RedisFuture<List<V>> arlastitems(K key, long count, boolean rev)
key - the key of the array.count - the number of items to return.rev - true to return items in reverse insertion order, false for insertion order.@Experimental RedisFuture<List<IndexedValue<V>>> arscan(K key, long start, long end)
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).IndexedValue pairs.@Experimental RedisFuture<List<IndexedValue<V>>> arscan(K key, long start, long end, long limit)
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).limit - the maximum number of entries to return.IndexedValue pairs.@Experimental RedisFuture<List<Long>> argrep(K key, ArGrepArgs grepArgs)
key - the key of the array.grepArgs - the grep arguments (range, predicates, flags).@Experimental RedisFuture<List<IndexedValue<V>>> argrepWithValues(K key, ArGrepArgs grepArgs)
key - the key of the array.grepArgs - the grep arguments (range, predicates, flags).IndexedValue pairs.@Experimental RedisFuture<V> aropAggregate(K key, long start, long end, ArAggregateType operation)
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).operation - the aggregate operation.null if the range is empty or values are non-numeric.@Experimental RedisFuture<Long> aropBitwise(K key, long start, long end, ArBitwiseType operation)
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).operation - the bitwise operation.@Experimental RedisFuture<Long> aropCount(K key, long start, long end)
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).@Experimental RedisFuture<Long> aropCount(K key, long start, long end, V matchValue)
key - the key of the array.start - the start index (inclusive).end - the end index (inclusive).matchValue - the value to match.@Experimental RedisFuture<Long> arinsert(K key, V value)
key - the key of the array.value - the value to insert.@Experimental RedisFuture<Long> arinsert(K key, V... values)
key - the key of the array.values - the values to insert.@Experimental RedisFuture<Long> arring(K key, long size, V value)
key - the key of the array.size - the ring buffer size.value - the value to insert.@Experimental RedisFuture<Long> arring(K key, long size, V... values)
key - the key of the array.size - the ring buffer size.values - the values to insert.@Experimental RedisFuture<Long> arseek(K key, long index)
key - the key of the array.index - the index to seek to.@Experimental RedisFuture<ArrayInfo> arinfo(K key)
ArrayInfo.getInfo();key - the key of the array.null if the key does not exist.@Experimental RedisFuture<ArrayInfoFull> arinfoFull(K key)
ArrayInfo.getInfo();key - the key of the array.null if the key does not exist.Copyright © 2026 lettuce.io. All rights reserved.