rpop

RPOP

RPOP key

Removes and returns the last element of the list stored at key.

Return value

Bulk string reply: the value of the last element, or nil when key does not exist.

Examples

redis> RPUSH mylist "one" (integer) 1 redis> RPUSH mylist "two" (integer) 2 redis> RPUSH mylist "three" (integer) 3 redis> RPOP mylist "three" redis> LRANGE mylist 0 -1 1) "one" 2) "two"

© 2009–2017 Salvatore Sanfilippo
Licensed under the Creative Commons Attribution-ShareAlike License 4.0.
https://redis.io/commands/rpop

w3cschool C语言课程
二维码
建议反馈
二维码