English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Rpushx Command

Redis Lists (List)

The Redis Rpushx command is used to insert a value at the end of an existing list (the rightmost end). If the list does not exist, the operation is invalid.

Syntax

Basic Syntax of Redis Rpushx Command:

redis 127.0.0.1:6379> RPUSHX KEY_NAME VALUE1..VALUEN

Available Version

>= 2.2.0

Return Value

The length of the list after executing the Rpushx operation.

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