ARINSERT

ARINSERT key value [value ...]
Available since:
Redis Open Source 8.8.0
Time complexity:
O(N) where N is the number of values
ACL categories:
ARRAY,

Inserts one or more values at consecutive indices.

Required arguments

key

The name of the key that holds the array.

value

One or more string values to insert at consecutive indices, beginning at the current insert cursor position. The cursor advances by one for each value inserted. Use ARNEXT to inspect the current cursor position and ARSEEK to reposition it.

Examples

ARINSERT myarray "alpha" ARINSERT myarray "beta" ARINSERT myarray "gamma" ARGET myarray 1 ARNEXT myarray

Return information

Integer reply: The last index where a value was inserted.
RATE THIS PAGE
Back to top ↑