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尚不存在时,不会执行任何操作。

示例

RPUSH mylist "Hello" RPUSHX mylist "World" RPUSHX myotherlist "World" LRANGE mylist 0 -1 LRANGE myotherlist 0 -1

RESP2/RESP3 回复

Integer reply: the length of the list after the push operation.

历史

  • 从 Redis 版本 4.0.0 开始:接受多个 element 参数。
RATE THIS PAGE
Back to top ↑