Arrays

Sparse arrays addressed by index, with an insert cursor and ring buffers: Redis 8.8's array type (AR*).

18 commands in KiviDB 1.1.2. Every command.

  • ARCOUNT: Returns the number of filled slots; 0 for a missing key.
  • ARDEL: Empties the slots at the given indexes.
  • ARDELRANGE: Empties the slots in one or more ranges, each from start to end, both included.
  • ARGET: Returns the value at index, or nil for an empty slot.
  • ARGETRANGE: Returns every slot from start to end, both included, nil for empty ones.
  • ARGREP: Returns the indexes of the slots from start to end whose values match.
  • ARINFO: Returns the array's filled slots (count), its len, the insert cursor (next-insert-index), and how it is laid out in memory: its slices of slice-size slots, and the directories that find them.
  • ARINSERT: Writes values at the array's insert cursor, moving the cursor on one slot per value.
  • ARLASTITEMS: Returns the count slots before the insert cursor, oldest first, or newest first with REV, nil for empty ones.
  • ARLEN: Returns the highest filled index plus one; 0 for a missing key.
  • ARMGET: Returns the values at several indexes, in the order given, nil for empty slots.
  • ARMSET: Sets values at several indexes, in any order, in one call.
  • ARNEXT: Returns the index the next ARINSERT will use: 0 for a missing key, nil once the cursor has run past the last index.
  • AROP: Computes over the filled slots from start to end.
  • ARRING: Writes values into a ring buffer of size slots: the cursor wraps around at size, so newer values overwrite the oldest.
  • ARSCAN: Returns the filled slots from start to end, skipping empty ones, as [index, value] pairs; in reverse with start greater than end.
  • ARSEEK: Moves the insert cursor to index.
  • ARSET: Sets values in the array at key from index on, one slot each.