---
title: "zcount · RUAL Documentation"
description: "Counts the members of a sorted set with a score between min and max. A RUAL redis block in the redis sorted sets group. See its pins and version history."
canonical: https://docs.rual.nl/block-types/redis/redis_zcount
language: en
---

# zcount

This block is part of the [`redis`](https://docs.rual.nl/block-types/redis) group and was last modified in core [`v15.0.3`](https://docs.rual.nl/core-versions/150003).

## Redis Key Selection Required

This block relies on a Redis key to perform its redis releated actions. You must manually select the Redis key you want to use in the flow in the blueprint using the Redis key selector modal. To access the modal, click the white button on the block.

Counts the members of a sorted set with a score between min and max.

- flow

- set `value` required key of the sorted set

- min `value` lowest score, default -inf

- max `value` highest score, default +inf

- flow

- number `number`

- success `condition`

- error `value`

- key `value`

min and max are redis_zrangebyscore's bounds: a number, or a Redis bound as text ("-inf", "+inf", "(5" for exclusive); a bound that is not wired is the open end, one that cannot be read is INVALID_BOUND and nothing is counted. number is the count; 0 for a key that is not there. A key of another type is an error (WRONGTYPE ...), never an empty answer.

| `redis zcount` |
| --- |
| `zcount` |
| `count by score` |

## Version history

Introduced in [`v15.0.3`](https://docs.rual.nl/core-versions/150003).

## Service documentation

- [External API reference](https://redis.io/commands/zcount/): This block wraps a third-party service. Click here for the service's own documentation of the underlying endpoint.

- [Back to `redis`](https://docs.rual.nl/block-types/redis): Return to the main group to view all sub-groups

- [Back to `redis sorted sets`](https://docs.rual.nl/block-types/redis?group=redis%20sorted%20sets): Return to the group to view all blocks within this group
