ARSET

Since 1.1.0Arrays

Syntax

ARSET key index value [value ...]
  • Flags: write
  • ACL categories: @array, @slow, @write
  • Arity: -2

Sets values in the array at key from index on, one slot each. An array is sparse: slots are addressed by index, from 0, and only filled ones take memory. A missing key is created. Arrays are Redis 8.8's type; TYPE reports array.

Reply

  • The number of slots that were empty and are now filled.

Examples

> ARSET a 0 x y z
(integer) 3
> ARSET a 5 w
(integer) 1
> TYPE a
array