zrange #
Returns elements depending on their position in the sorted set.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/ms/_zrange/<_id>?start=<index start>&stop=<index stop>[&options=withscores]
Method: GET
Other protocols #
{
"controller": "ms",
"action": "zrange",
"_id": "<key>",
"start": <index start>,
"stop": <index stop>,
// optional
"options": ["withscores"]
}
Arguments #
_id
: sorted set identifierstart
: starting position index, inclusivestop
: ending position index, inclusive
Optional: #
withscores
: return the score alongside the found elements
Response #
By default, returns the list of elements in the provided index range:
{
"requestId": "<unique request identifier>",
"status": 200,
"error": null,
"controller": "ms",
"action": "zrange",
"collection": null,
"index": null,
"result": [
"element1",
"element2",
"..."
]
}
If the withscores
option is provided, then the returned array alternates elements with their score:
{
"requestId": "<unique request identifier>",
"status": 200,
"error": null,
"controller": "ms",
"action": "zrange",
"collection": null,
"index": null,
"result": [
"element1",
"score of element1",
"element2",
"score of element2",
"..."
]
}
Edit this page on Github (opens new window)