redis LRANGE command


  Translation results:

range

UK[reɪndʒ] US[rendʒ]

n.Range; range; category; (mountains, houses, etc.) arrangement

vi.Search; change; extend; roam

vt. Arrange; (according to a certain position or order) sort; classify...; wander

adj. pasture, grazing area

Third person singular: ranges Plural: ranges Present participle: ranging Past tense: ranged Past participle: ranged

redis LRANGE commandsyntax

Function: Return the elements in the specified interval in the list key, and the interval is specified by the offset start and stop.

Syntax: LRANGE key start stop

Description: The index parameters start and stop are both base 0, that is to say , with 0 representing the first element of the list, 1 representing the second element of the list, and so on. You can also use negative subscripts, with -1 representing the last element of the list, -2 representing the penultimate element of the list, and so on.

Available versions: >= 1.0.0

Time complexity: O(S N), S is the offset start, N is the number of elements in the specified range.

Returns: A list containing elements within the specified range.

redis LRANGE commandexample

redis> RPUSH fp-language lisp
(integer) 1
redis> LRANGE fp-language 0 0
1) "lisp"
redis> RPUSH fp-language scheme
(integer) 2
redis> LRANGE fp-language 0 1
1) "lisp"
2) "scheme"

Home

Videos

Q&A