rpush
RPUSH
Apply for Redis Developer Course
|
Redis Regular Inspection / Technical Support
|
Redis Enterprise Server
|
|---|
Push data to the right of the list
Usage: rpush key value.
Returns the number of elements in the list after the push.
Example
| Command> | rpush mylist value1 |
| Result> | 1 |
| Command> | rpush mylist value2 |
| Result> | 2 |
| Command> | lrange mylist 0 -1 look up the data stored in the key |
| Result> | 0) value1 1) value2 |
| Command> | rpush mylist value3 value4 you can specify multiple values |
| Result> | 4 |
| Command> | lrange mylist 0 -1 |
| Result> | 0) value1 1) value2 2) value3 3) value4 |
Syntax
RPUSH key value [value ...]
- Available since version 1.0.0.
- Time complexity is O(1).
Command history
Since version 2.4 you can specify multiple values.
| Related commands | LPUSH, LPOP, RPOP |
| Clients for Java | Jedis, Lettuce, Redisson | Clients for C | Hiredis |
| << LPOP | RPUSH | RPUSHS >> |
|---|
Email
답글이 올라오면 이메일로 알려드리겠습니다.
