Upstash Documentation

ARDEL

Delete values at the given array indexes.
2 min read

Use ARDEL to empty one or more array slots.

Deleting a slot leaves a hole rather than shifting later values down, so every other index keeps its meaning. The reply counts the slots that actually held a value, so indexes that were already empty do not inflate it. Removing the last remaining value deletes the key.

Deletion does not move the append cursor: ARNEXT still reports the slot after the highest index ever appended, so an ARINSERT will not silently reuse a freed index.

See the array command overview for the data model these commands share.

Syntax#

Arguments#

ArgumentRequiredRepeatableDescription
<key>YesNoArray key targeted by the command.
<index>YesYesZero-based index to clear. Repeat to clear several slots in one call.

Response#

The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.

ProtocolReply
RESP2Integer
RESP3Integer
Note

Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.

Examples#

TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.

Redis CLI
@upstash/redis
Note

This command is not supported yet in @upstash/redis.

upstash_redis
Note

This command is not supported yet in upstash_redis.

ioredis
node-redis
redis-py
go-redis
jedis
redis-rs