RPUSHX

Since 1.1.0Lists

Syntax

RPUSHX key value [value ...]
  • Flags: fast, write
  • ACL categories: @fast, @list, @write
  • Arity: -3

Adds values to the tail of the list at key, only if the list exists.

Reply

  • The length of the list afterwards.
  • 0 if the key does not exist; nothing is created.

Examples

> RPUSH x 1
(integer) 1
> RPUSHX x 2
(integer) 2
> LRANGE x 0 -1
1) "1"
2) "2"