First, you need to understand the concepts of stacks and queues first:
Stack advanced after: The Bullets on the analogy magazine, the last bullet bullets first use, drywall brick, from behind
Queue FIFO: line up for rice, first come first served
To create a list:
Add to Left: (Stack form Add)
# Output: " 5 " " 4 " " 3 " " 2 " " 1 "
Right add: (added as queue)
Rpush List 1 2 3 4 5# output:"1"2) "2"3) " 3 "4) "4"5) "5"
To view the list:
Lrange list 0-1 # Index View 0 (first bit)-1 (last)
View Length:
Llen list # returns a number
View the specified element: (index)
# The 4th element is viewed here from the 0th bit
To delete an element:
Lpop list # Delete rpop List # from the left to Delete from the right
Delete the specified number of elements:
Lrem List 3 (number) 5(Element)# means to remove 3 ' 5 ' from the top of this element # If it is-3 means to remove 3 ' 5 ' from the bottom of the element
--list List of Redis database operations under LUnix