Tutorial by Examples

Redis allows you to add items to either the right or the left of a list. If I was working with a list, my_list and I wanted to prepend 3 to the list, I could do that using the Redis LPUSH command: LPUSH my_list 3 If I wanted to append 3 to my_list, I would instead use the RPUSH command: RPUSH ...
Redis provides the LPOP and RPOP commands as a counterpart to the LPUSH and RPUSH commands for fetching data items. If I was working with a list my_list that had several data items in it already, I can get the first item in the list using the LPOP command: LPOP my_list The result of this comman...
The size of a Redis list can be deterimed using the LLEN command. If I have a four element list stored at the key my_list, I can get the size using: LLEN my_list which will return 4. If a user specifies a key that doesn't exist to LLEN, it will return a zero, but if a key is used that points t...

Page 1 of 1