1. List
Introduced:
List is a linked list structure, the main function is push, pop, get all the values of a range and so on, the operation of key is understood as the name of the list.
The Redis list type is actually a doubly linked list in which each child element is a string type.
We can add delete elements from the head or tail of the list by push, pop operations, so that the list can be both a stack and a queue.
Method:
1. Lpush add string element to the head of key corresponding list Lpush mylist "World" Lpush mylist "Hello" Lrange mylist 0-1 return to Hello World
2. Rpust adds a string element to the tail of key corresponding list Rpust mylist "World" Rpush mylist "Hello" Lrange mylist 0-1 return to Hello World
3. Linsert adds a string before or after key corresponds to a specific position in the list Rpush mylist3 "World" Linsert Mylist3 before "world" "Hello"
Redis data Type-linked list (list)