Explain the list operations available in Redis.

The list operations are given below :
 
LPOP : An element is removed from the head by it.

RPOP : An element is removed from the tail by it.

LPUSH : A new element is inserted on the head by this operation.

RPUSH : A new element is inserted on the head by this operation.

LRANGE : An element is printed from the specified position


Example :
 
127.0.0.1:6379> LPUSH A 1
 
127.0.0.1:6379> RPUSH A 2
 
127.0.0.1:6379> RPUSH A 3
 
127.0.0.1:6379> RPUSH A 4
 
127.0.0.1:6379> LRANGE A 0 -1
 
1) "1"
 
2) "2"
 
3) "3"
 
4) "4"
 
127.0.0.1:6379> LPOP A
 
"1" ["1" element value is removed]
 
127.0.0.1:6379> LRANGE A 0 -1
 
1) "2"
 
2) "3"
 
3) "4"
 
127.0.0.1:6379> RPOP A
 
"4" ["4" element value is removed]
 
127.0.0.1:6379> LRANGE A 0 -1
 
1) "2"
 
2) "3"