ARLASTITEMS
ARLASTITEMS key count [REV]
- Available since:
- Redis Open Source 8.8.0
- Time complexity:
- O(N) where N is the count
- ACL categories:
-
@read,@array,@slow, - Compatibility:
- Redis Software and Redis Cloud compatibility
Returns the most recently inserted elements.
Required arguments
key
The name of the key that holds the array.
count
The maximum number of most recently inserted elements to return. If the array contains fewer elements than count, all elements are returned.
Optional arguments
REV
When present, returns elements in reverse chronological order (most recent first) instead of the default oldest-first order.
Examples
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ❌ Standard |
❌ Standard |