Lists Rpush
# Redis Rpush Command
[!(#) Redis Lists](#)
The Redis Rpush command is used to append one or more values to the end (right side) of a list.
If the list does not exist, an empty list will be created and the RPUSH operation will be performed. If the key exists but is not a list, an error will be returned.
**Note:** Prior to Redis version 2.4, the RPUSH command only accepted a single value.
### Syntax
The basic syntax of the Redis Rpush command is as follows:
redis 127.0.0.1:6379> RPUSH KEY_NAME VALUE1..VALUEN
### Available Versions
>= 1.0.0
### Return Value
After executing the RPUSH operation, the length of the list is returned.
### 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> RPUSH mylist "bar"(integer) 3 redis 127.0.0.1:6379> LRANGE mylist 0 -11) "hello"2) "foo"3) "bar"
[!(#) Redis Lists](#)
AI is thinking...
[](#)(#)
(#)[](#)
[Byte Ark Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., with official direct supply that is stable and reliable. Configuration guide Β₯9.9/month Activate now](https://www.volcengine.com/ac
YouTip