Sunday 12 April 2015

RPOPLPUSH source destination

Syntax
RPOPLPUSH source destination
    Perform RPOP on source list and insert poped element to the element at the first element (head) of the list stored at destination.

Returns
    Returns the elemnent being poped and pushed.
127.0.0.1:6379> rpush list1 1 2 3 4 5 
(integer) 5 
127.0.0.1:6379> rpush list2 6 7 8 9 10 
(integer) 5 
127.0.0.1:6379> rpoplpush list1 list2 
"5" 
127.0.0.1:6379> lrange list2 0 6 
1) "5" 
2) "6" 
3) "7" 
4) "8" 
5) "9" 
6) "10" 

 
Prevoius                                                 Next                                                 Home

No comments:

Post a Comment