Redis Zremrangebyscore 命令

Redis 教程 · 2019-03-07 23:11:59

Redis Zremrangebyscore 命令用于移除有序集中,指定分数(score)区间内的所有成员。

语法

redis Zremrangebyscore 命令基本语法如下:

redis 127.0.0.1:6379> ZREMRANGEBYSCORE key min max

可用版本

>= 1.2.0

返回值

被移除成员的数量。

实例

redis 127.0.0.1:6379> ZRANGE salary 0 -1 WITHSCORES          # 显示有序集内所有成员及其 score 值
1) "tom"
2) "2000"
3) "peter"
4) "3500"
5) "jack"
6) "5000"

redis 127.0.0.1:6379> ZREMRANGEBYSCORE salary 1500 3500      # 移除所有薪水在 1500 到 3500 内的员工
(integer) 2

redis> ZRANGE salary 0 -1 WITHSCORES          # 剩下的有序集成员
1) "jack"
2) "5000"

点击查看所有 Redis 教程 文章: https://codercto.com/courses/l/33.html

查看所有标签

Head First Python

Head First Python

Paul Barry / O'Reilly Media / 2010-11-30 / USD 49.99

Are you keen to add Python to your programming skills? Learn quickly and have some fun at the same time with Head First Python. This book takes you beyond typical how-to manuals with engaging images, ......一起来看看 《Head First Python》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试