# RPUSH

> Append one or more elements to the tail of a list.

URL: https://docs.hotkv.com/commands/rpush/

```
RPUSH key element [element ...]
```

- Group: List
- Complexity: O(1) for each element added
- HotKV Cloud: all plans
- On-Premise: no license needed

`RPUSH` appends each `element` to the tail (right end) of the list stored at
`key`, creating the list if the key does not exist. Elements keep the order
you give them.

Pushing to a list wakes clients blocked on it with
[BLPOP](https://docs.hotkv.com/commands/blpop/index.md) and related commands.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Success | Integer: the length of the list after the push | Same |

`RPUSH` replies with a `WRONGTYPE` error if `key` holds a value that is not a
list.

## Examples

```
127.0.0.1:6379> RPUSH queue a b c
(integer) 3
127.0.0.1:6379> LRANGE queue 0 -1
1) "a"
2) "b"
3) "c"
```

## Compatibility

Same as Redis 7.4 and Valkey 8.

## See also

[LPUSH](https://docs.hotkv.com/commands/lpush/index.md), [RPUSHX](https://docs.hotkv.com/commands/rpushx/index.md), [RPOP](https://docs.hotkv.com/commands/rpop/index.md),
[LRANGE](https://docs.hotkv.com/commands/lrange/index.md), [BRPOP](https://docs.hotkv.com/commands/brpop/index.md)