How to print all values in a list with redis-cli without knowing the size of the list?

einnocent picture einnocent · Dec 29, 2013 · Viewed 15.5k times · Source

In redis-cli, what is the command to print all the values in a list without knowing in advance the size of the list? I see lrange, but it requires naming the start index and the end index.

Answer

Zitrax picture Zitrax · Sep 3, 2014

You use -1 to indicate end of list so:

LRANGE key 0 -1

would print all.