Redis Rpushx Command
The Redis Rpushx command is used to insert a value at the tail (rightmost) of an existing list. If the list does not exist, the operation has no effect.
Syntax
The basic syntax of the redis Rpushx command is as follows:
redis 127.0.0.1:6379> RPUSHX KEY_NAME VALUE1..VALUEN
Available Version
= 2.2.0
Return Value
The length of the list after the Rpushx operation.
Example
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> RPUSHX mylist2 "bar"
(integer) 0
redis 127.0.0.1:6379> LRANGE mylist 0 -1
1) "hello"
2) "foo"
Redis List