Core
API v2.x
2

# zcount

Returns the number of elements held by a sorted set with a score within the provided min and max values.

[Redis documentation]


# Query Syntax

# HTTP

Copied to clipboard!
URL: http://kuzzle:7512/ms/_zcount/<_id>?min=<min score>&max=<max score>
Method: GET

# Other protocols

Copied to clipboard!
{
  "controller": "ms",
  "action": "zcount",
  "_id": "<key>",
  "min": "<min score>",
  "max": "<max score>"
}

# Arguments

  • _id: sorted set identifier
  • min: minimum score
  • max: maximum score

By default, the provided min and max values are inclusive. This behavior can be changed using the syntax described in the Redis ZRANGEBYSCORE documentation.


# Response

Returns the number of elements within the specified range.

Copied to clipboard!
{
  "requestId": "<unique request identifier>",
  "status": 200,
  "error": null,
  "controller": "ms",
  "action": "zcount",
  "collection": null,
  "index": null,
  "result": 3
}