Skip to main content
Use ARLASTITEMS to read the values written most recently, without knowing where the cursor currently sits. The command walks backward from the append cursor, wrapping to the end of the array when it passes index 0, and collects up to <count> values. That wrapping is what makes it the natural reader for a ring built with ARRING: it returns the current window in write order regardless of where the ring has wrapped to. On a plain array appended to with ARINSERT, it returns the tail. By default the values come back oldest-first, which is the order they were written in. REV reverses that, returning the newest value first. Slots that are empty come back as null, and <count> is capped at the number of values the array holds. See the array command overview for the data model these commands share.

Syntax

Arguments

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.
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.
This command is not supported yet in @upstash/redis.
This command is not supported yet in upstash_redis.