LPUSHX

Since 1.1.0Lists

Syntax

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

Adds values to the head 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

> LPUSHX nolist a
(integer) 0
> RPUSH x 1
(integer) 1
> LPUSHX x 0
(integer) 2