zrevrange #
Identical to zrange, except that the sorted set is traversed in descending order.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/ms/_zrevrange/<_id>?start=<index start>&stop=<index stop>[&options=withscores]
Method: GET
Other protocols #
{
"controller": "ms",
"action": "zrevrange",
"_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": [
"...",
"element2",
"element1"
]
}
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": [
"...",
"element2",
"score of element2",
"element1",
"score of element1"
]
}
Edit this page on Github(opens new window)