...

Big Data - Redis

Back to Course

Lesson Description


Lession - #1178 Redis Lists


Redis Lists are just lists of strings, arranged by addition request. It is feasible to add components to a Redis List pushing new components on the head (on the left>
or on the tail (on the right>
of the list. The LPUSH order embeds another component on the head, while RPUSH embeds another component on the tail.

How would I create a list in Redis?

Redis reads lists from left to right, and you can add new rundown components to the top of a rundown (the "left" end>
with the lpush order or the tail (the "right" end>
with rpush . You can likewise utilize lpush or rpush to make another rundown: lpush key worth.





Example


redis 127.0.0.1:6379> LPUSH tutorials redis 
(integer>
1 redis 127.0.0.1:6379> LPUSH tutorials techedhub (integer>
2 redis 127.0.0.1:6379> LPUSH tutorials sdfh (integer>
3 redis 127.0.0.1:6379> LRANGE tutorials 0 10 1>
"sdfh" 2>
"techedhub" 3>
"redis"