Sunday 12 April 2015

Redis List commands

List is a sequence of ordered elements, for example 10, 5, 16, 20, 19 is a list. Redis lists are implemented as linked lists. Since lists in redis are implemented as linked list, adding elements to head/ tail of the list is faster, but accessing element using index is slow.

Redis provides number of commands to work with list.
Pushes all the values to the head of the list stored at key.
Insert value into the list only if list exists
Insert all the specified values at the tail of the list
Inserts value at the tail of the list
Removes and returns the first element of the list
Removes and reurns the last element of the list
Returns elements of list for specified range
Removes first count occurrences of value from the list
Sets the list index with given value
Returns the element at specific index of the list
Returns the length of the list
Trim the list, so that it will contain only the specified range of elements specified
Insert the value into the list just before/after pivot value
BLPOP key1 key2 ... keyN timeout
BRPOP key1, key2 ...keyN timeout
RPOPLPUSH source destination
BRPOPLPUSH source destination timeout  


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment