Lists Lrange
# Redis Lrange Command
[!(#) Redis Lists](#)
Redis Lrange returns the specified elements of the list stored at key. The offsets start and stop are zero-based indexes, with 0 being the first element of the list, 1 being the next element, and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last element, -2 being the penultimate, and so on.
### Syntax
The basic syntax of redis Lrange command is as follows:
redis 127.0.0.1:6379> LRANGE KEY_NAME START END
### Available Version
>= 1.0.0
### Return Value
A list of elements in the specified range.
### Examples
redis> RPUSH mylist "one"(integer) 1 redis> RPUSH mylist "two"(integer) 2 redis> RPUSH mylist "three"(integer) 3 redis> LRANGE mylist 0 01) "one" redis> LRANGE mylist -3 21) "one"2) "two"3) "three" redis> LRANGE mylist -100 1001) "one"2) "two"3) "three" redis> LRANGE mylist 5 10(empty list or set) redis>
[!(#) Redis Lists](#)
YouTip