Redis Zcount 命令

Redis 教程 · 2019-03-07 20:27:35

Redis Zcount 命令用于计算有序集合中指定分数区间的成员数量。

语法

redis Zcount 命令基本语法如下:

redis 127.0.0.1:6379> ZCOUNT key min max

可用版本

>= 2.0.0

返回值

分数值在 min 和 max 之间的成员的数量。

实例

redis 127.0.0.1:6379> ZADD myzset 1 "hello"
(integer) 1
redis 127.0.0.1:6379> ZADD myzset 1 "foo"
(integer) 1
redis 127.0.0.1:6379> ZADD myzset 2 "world" 3 "bar"
(integer) 2
redis 127.0.0.1:6379> ZCOUNT myzset 1 3
(integer) 4

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

查看所有标签

图形程序开发人员指南

图形程序开发人员指南

Michael Abrash / 前导工作室 / 机械工业出版社 / 1998 / 128

Michael Abrash's classic Graphics Programming Black Book is a compilation of Michael's previous writings on assembly language and graphics programming (including from his "Graphics Programming" column......一起来看看 《图形程序开发人员指南》 这本书的介绍吧!

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

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换