Redis命令-有序集合-zremrangebyscore
原文
http://redis.io/commands/zremrangebyscore
简介
Remove all members in a sorted set within the given scores.
从有序集合中删除指定分数范围内的所有成员。
语法
ZREMRANGEBYSCORE key min max
版本
Available since 1.2.0.
自1.2.0版本可用。
时间复杂度
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
O(log(N)+M):N是有序集合中元素的数量,M是要删除的元素的数量。
描述
Removes all elements in the sorted set stored at key with a score between min and max (inclusive).
从有序集合中删除分数在min到max之间(包含min和max)的所有元素。
Since version 2.1.6, min and max can be exclusive, following the syntax of ZRANGEBYSCORE.
从Redis 2.1.6开始,min和max可以被排除,与ZRANGEBYSCORE语法相同。
返回值
Integer reply: the number of elements removed.
Integer:删除的元素的数量。
例子
redis> ZADD myzset 1 "one"
(integer) 1
redis> ZADD myzset 2 "two"
(integer) 1
redis> ZADD myzset 3 "three"
(integer) 1
redis> ZREMRANGEBYSCORE myzset -inf (2
(integer) 1
redis> ZRANGE myzset 0 -1 WITHSCORES
1) "two"
2) "2"
3) "three"
4) "3"
redis>
- Redis有序集合命令ZRANGEBYSCORE|ZREVRANGEBYSCORE|ZREMRANGEBYRANK|ZREMRANGEBYSCORE
- Redis命令-有序集合-zremrangebylex
- Redis有序集合命令ZRANGEBYLEX详解与应用
- Redis命令-有序集合-zscore
- Redis命令zrange,zrangebyscore,zrevrank,zremrangebyscore
- Redis从基础命令到实战之有序集合类型(SortedSet)
- Redis常用命令入门5:有序集合类型
- redis学习笔记五之基础命令—有序集合
- Java实现Redis的有序集合(sortedset)命令
- Redis有序集合数据类型操作命令
- Redis 有序集合命令
- Redis的有序集合|ZADD|ZREM|ZSCORE|ZINCRBY
- Redis大总结之三:SORT命令(对 列表|集合|有序集合 进行排序)
- Redis命令-有序集合-zscan
- redis基本命令之二:集合、有序集合
- Redis有序集合数据类型操作命令
- Redis命令学习-SortedSet(有序集合)
- Redis有序集合命令ZRANK|ZREVRANk|ZRANGE|ZREVRANGE
- redis源码分析(七)、redis命令学习总结—Redis 有序集合(sorted set)
- Redis有序集合命令ZCARD|ZCOUNT|ZUNIONSTORE|ZINTERSTORE