> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Array commands

> Commands for storing values in a sparse, index-addressed array.

An array stores string values under unsigned integer indexes, from `0` up to `18446744073709551614`. It is sparse: an index either holds a value or is empty, and writing to a distant index does not allocate the slots in between. Nothing shifts when a value is deleted, so an index keeps its meaning for the lifetime of the key. That makes an array the right shape for data that already has a natural numeric key, such as a sequence number or a bucketed timestamp, where a [list](/docs/redis/commands/list/overview) would force a scan and a [hash](/docs/redis/commands/hash/overview) would store the index as a string.

Two numbers describe an array and they are not the same. [`ARCOUNT`](/docs/redis/commands/array/arcount) is how many slots hold a value; [`ARLEN`](/docs/redis/commands/array/arlen) is the highest occupied index plus one. They agree only when the array is densely filled from `0`.

Each array also keeps an append cursor, holding the index the last append wrote to. [`ARINSERT`](/docs/redis/commands/array/arinsert) appends after it, [`ARRING`](/docs/redis/commands/array/arring) appends after it and wraps within a fixed number of slots, [`ARNEXT`](/docs/redis/commands/array/arnext) reads where the next append will land, and [`ARSEEK`](/docs/redis/commands/array/arseek) moves it. The cursor tracks appends only: positional writes with [`ARSET`](/docs/redis/commands/array/arset) and deletions never move it, so a freed index is never silently reused.

<CardGroup cols={2}>
  <Card title="ARSET" href="/docs/redis/commands/array/arset">
    Set contiguous array values from an index
  </Card>

  <Card title="ARMSET" href="/docs/redis/commands/array/armset">
    Set values at several array indexes
  </Card>

  <Card title="ARGET" href="/docs/redis/commands/array/arget">
    Get the value at an array index
  </Card>

  <Card title="ARMGET" href="/docs/redis/commands/array/armget">
    Get the values at several array indexes
  </Card>

  <Card title="ARGETRANGE" href="/docs/redis/commands/array/argetrange">
    Get array values in an index range
  </Card>

  <Card title="ARSCAN" href="/docs/redis/commands/array/arscan">
    Scan the populated slots of an array
  </Card>

  <Card title="ARGREP" href="/docs/redis/commands/array/argrep">
    Search array values with predicates
  </Card>

  <Card title="ARDEL" href="/docs/redis/commands/array/ardel">
    Delete values at the given array indexes
  </Card>

  <Card title="ARDELRANGE" href="/docs/redis/commands/array/ardelrange">
    Delete array values in one or more index ranges
  </Card>

  <Card title="ARCOUNT" href="/docs/redis/commands/array/arcount">
    Count the values stored in an array
  </Card>

  <Card title="ARLEN" href="/docs/redis/commands/array/arlen">
    Get the length of an array
  </Card>

  <Card title="ARINSERT" href="/docs/redis/commands/array/arinsert">
    Append values to an array
  </Card>

  <Card title="ARRING" href="/docs/redis/commands/array/arring">
    Append values to a fixed-size ring
  </Card>

  <Card title="ARLASTITEMS" href="/docs/redis/commands/array/arlastitems">
    Read the most recently written array values
  </Card>

  <Card title="ARNEXT" href="/docs/redis/commands/array/arnext">
    Get the index the next append will use
  </Card>

  <Card title="ARSEEK" href="/docs/redis/commands/array/arseek">
    Move the array append cursor
  </Card>

  <Card title="AROP" href="/docs/redis/commands/array/arop">
    Aggregate array values in an index range
  </Card>

  <Card title="ARINFO" href="/docs/redis/commands/array/arinfo">
    Inspect the internal layout of an array
  </Card>
</CardGroup>


## Related topics

- [ARLEN](/docs/redis/commands/array/arlen.md)
- [ARCOUNT](/docs/redis/commands/array/arcount.md)
- [ARLASTITEMS](/docs/redis/commands/array/arlastitems.md)
- [ARINFO](/docs/redis/commands/array/arinfo.md)
- [ARGET](/docs/redis/commands/array/arget.md)
