Sunday, 12 April 2015

LPOP key

Syntax
LPOP key
     Removes and returns the first element of the list stored at key.

Returns
Reurns the removed element from the list, null if the list is empty.

127.0.0.1:6379> lrange id 0 3 
(empty list or set) 
127.0.0.1:6379> lrange ids 0 3 
1) "1" 
2) "3" 
3) "2" 
4) "1" 
127.0.0.1:6379> lpop ids 
"1" 
127.0.0.1:6379> lrange ids 0 3 
1) "3" 
2) "2" 
3) "1" 
127.0.0.1:6379> lpop ids 
"3" 
127.0.0.1:6379> lrange ids 0 3 
1) "2" 
2) "1" 

Prevoius                                                 Next                                                 Home

No comments:

Post a Comment