Latest web development tutorials

Redis Rpushx command

Redis list (List)

Redis Rpushx command is used to insert one or more values ​​to the existing end of the list (far right). If the list does not exist, the operation is invalid.

grammar

redis Rpushx basic command syntax is as follows:

redis 127.0.0.1:6379> RPUSHX KEY_NAME VALUE1..VALUEN

Available versions

> = 2.2.0

return value

After performing Rpushx operation, the length of the list.

Examples

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 (List)