English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis Rpoplpush command is used to remove the last element from a list, add it to another list, and return it.
redis Rpoplpush command syntax is as follows:
redis 127.0.0.1:6379> RPOPLPUSH SOURCE_KEY_NAME DESTINATION_KEY_NAME
>= 1.0.0
The popped element.
redis 127.0.0.1:6379> RPUSH mylist "hello" (integer) 1 redis 127.0.0.1:6379> RPUSH mylist "foo" (integer) 2 redis 127.0.0.1:6379> RPUSH mylist "bar" (integer) 3 redis 127.0.0.1:6379> RPOPLPUSH mylist myotherlist "bar" redis 127.0.0.1:6379> LRANGE mylist 0 -1 1) "hello" 2) "foo"