ZREM
Syntax
ZREM key member [member ...]
- Available since:
- 1.2.0
- Time complexity:
- O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed.
- ACL categories:
-
@write
,@sortedset
,@fast
,
从存储在key
的有序集合中移除指定的成员。不存在的成员将被忽略。
当key
存在且不持有排序集合时,将返回错误。
示例
RESP2/RESP3 回复
Integer reply: the number of members removed from the sorted set, not including non-existing members.历史
- 从 Redis 2.4.0 版本开始:接受多个元素。