Redis Zremrangebyrank 命令

Redis 教程 · 2019-03-07 22:56:45

Redis Zremrangebyrank 命令用于移除有序集中,指定排名(rank)区间内的所有成员。

语法

redis Zremrangebyrank 命令基本语法如下:

redis 127.0.0.1:6379> ZREMRANGEBYRANK key start stop

可用版本

>= 2.0.0

返回值

被移除成员的数量。

实例

redis 127.0.0.1:6379> ZADD salary 2000 jack
(integer) 1
redis 127.0.0.1:6379> ZADD salary 5000 tom
(integer) 1
redis 127.0.0.1:6379> ZADD salary 3500 peter
(integer) 1

redis 127.0.0.1:6379> ZREMRANGEBYRANK salary 0 1       # 移除下标 0 至 1 区间内的成员
(integer) 2

redis 127.0.0.1:6379> ZRANGE salary 0 -1 WITHSCORES    # 有序集只剩下一个成员
1) "tom"
2) "5000"

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

查看所有标签

Cracking the Coding Interview

Cracking the Coding Interview

Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95

Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

SHA 加密
SHA 加密

SHA 加密工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具