RPOPLPUSH

Since 1.1.0Lists

Syntax

RPOPLPUSH source destination
  • Flags: write
  • ACL categories: @list, @slow, @write
  • Arity: 3

Removes the last element of source and adds it to the head of destination. It is LMOVE source destination RIGHT LEFT; use LMOVE in new code.

Reply

  • The element moved, or nil if source does not exist.

Examples

> RPUSH src a b
(integer) 2
> RPOPLPUSH src dst
"b"