RPUSHX
Syntax
RPUSHX key element [element ...]
- Available since:
- 2.2.0
- Time complexity:
- O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
- ACL categories:
-
@write
,@list
,@fast
,
在存储在key
的列表的尾部插入指定的值,仅当key
已经存在并且持有一个列表时。
与RPUSH
相反,当key
尚不存在时,不会执行任何操作。
示例
RESP2/RESP3 回复
Integer reply: the length of the list after the push operation.历史
- 从 Redis 版本 4.0.0 开始:接受多个
element
参数。