English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Redis Sorted Sets (sorted set)
The Redis Zcount command is used to calculate the number of members within a specified score range in a sorted set.
Basic syntax of the redis Zcount command is as follows:
redis 127.0.0.1:6379> ZCOUNT key min max
>= 2.0.0
The number of members with scores between min and 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