LRANGE

    Returns the specified elements of the list stored at . The offsets start and stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on.

    Note that if you have a list of numbers from 0 to 100, LRANGE list 0 10 will return 11 elements, that is, the rightmost item is included. This may or may not be consistent with behavior of range-related functions in your programming language of choice (think Ruby’s Range.new, Array#slice or Python’s function).

    Array reply: list of elements in the specified range.

    1. dragonfly> RPUSH mylist "one"
    2. (integer) 1
    3. dragonfly> RPUSH mylist "two"
    4. dragonfly> RPUSH mylist "three"
    5. (integer) 3
    6. dragonfly> LRANGE mylist 0 0
    7. dragonfly> LRANGE mylist -3 2
    8. 1) "one"
    9. 2) "two"
    10. 3) "three"
    11. 1) "one"
    12. 2) "two"
    13. 3) "three"
    14. dragonfly> LRANGE mylist 5 10