Redis ZREMRANGEBYSCORE 命令移除有序集 key 中,所有 score 值介于 min 和 max 之间(包括等于 min 或 max )的成员。
注意:自版本 2.1.6 开始,score 值等于 min 或 max 的成员也可以不包括在内,详情请参见 ZRANGEBYSCORE 命令。
ZREMRANGEBYSCORE key min max
127.0.0.1:6379> ZADD salary 3000 jack 3500 helen 2880 john 4000 simith 6000 ros(integer) 5127.0.0.1:6379> ZRANGE salary 0 -1 withscores #显示所有成员与score值1) "john"2) "2880"3) "jack"4) "3000"5) "helen"6) "3500"7) "simith"8) "4000"9) "ros"10) "6000"127.0.0.1:6379> ZREMRANGEBYSCORE salary 4000 6000 #移除4000<=salary<=6000(integer) 2127.0.0.1:6379> ZRANGE salary 0 -1 withscores #查询剩余元素1) "john" 2) "2880"3) "jack"4) "3000"5) "helen"6) "3500"
