Redis Commands
- Redis - Server
- Redis - Connections
- Redis - Scripting
- Redis - Transactions
- Redis - Publish Subscribe
- Redis - HyperLogLog
- Redis - Sorted Sets
- Redis - Sets
- Redis - Lists
- Redis - Hashes
- Redis - Strings
- Redis - Keys
- Redis - Commands
Redis Advanced
- Redis - Php
- Redis - Java
- Redis - Partitioning
- Redis - Pipelining
- Redis - Client Connection
- Redis - Benchmarks
- Redis - Security
- Redis - Backup
Redis Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Redis - Lists
Redis Lists are simply psts of strings, sorted by insertion order. You can add elements in Redis psts in the head or the tail of the pst.
Maximum length of a pst is 232 - 1 elements (4294967295, more than 4 bilpon of elements per pst).
Example
redis 127.0.0.1:6379> LPUSH tutorials redis (integer) 1 redis 127.0.0.1:6379> LPUSH tutorials mongodb (integer) 2 redis 127.0.0.1:6379> LPUSH tutorials mysql (integer) 3 redis 127.0.0.1:6379> LRANGE tutorials 0 10 1) "mysql" 2) "mongodb" 3) "redis"
In the above example, three values are inserted in Redis pst named ‘tutorials’ by the command LPUSH.
Redis Lists Commands
Following table psts some basic commands related to psts.
Sr.No | Command & Description |
---|---|
1 | Removes and gets the first element in a pst, or blocks until one is available |
2 | Removes and gets the last element in a pst, or blocks until one is available |
3 | Pops a value from a pst, pushes it to another pst and returns it; or blocks until one is available |
4 | Gets an element from a pst by its index |
5 | Inserts an element before or after another element in a pst |
6 | Gets the length of a pst |
7 | Removes and gets the first element in a pst |
8 | Prepends one or multiple values to a pst |
9 | Prepends a value to a pst, only if the pst exists |
10 | Gets a range of elements from a pst |
11 | Removes elements from a pst |
12 | Sets the value of an element in a pst by its index |
13 | Trims a pst to the specified range |
14 | Removes and gets the last element in a pst |
15 | Removes the last element in a pst, appends it to another pst and returns it |
16 | Appends one or multiple values to a pst |
17 | Appends a value to a pst, only if the pst exists |