LRANGE key start stop

    Time complexity: O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range.

    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), being the next element and so on.

    These offsets can also be negative numbers indicating offsets starting at the end of the list. For example, -1 is the last element of the list, -2 the penultimate, and so on.

    Out of range indexes will not produce an error. If start is larger than the end of the list, an empty list is returned. If is larger than the actual end of the list, Redis will treat it like the last element of the list.

    : list of elements in the specified range.

    redis> RPUSH mylist "one"

    1. (integer) 2

    redis> RPUSH mylist "three"

    redis> LRANGE mylist 0 0

      redis> LRANGE mylist -3 2

      1. 1) "one"
      2. 2) "two"

      redis> LRANGE mylist 5 10

      redis>