Unknown SDK


Identical to zrangebyscore except that the sorted set is traversed in descending order.

[Redis documentation]

zrevrangebyscore(key, min, max, [options], [callback])

Arguments Type Description
key string Key identifier
min double Minimum score value (inclusive by default)
max double Maximum score value (inclusive by default)
options JSON Object Optional parameters
callback function Callback


Option Type Description Default
limit array Limit the result set to a range of matching elements (similar to SELECT LIMIT offset, count in SQL).
Format: [<offset(int)>, <count(int)>]
queuable boolean Make this request queuable or not true

Return value

Returns the MemoryStorage object to allow chaining.

Callback Response

Returns an array of matching members.


Copied to clipboard!
// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.zrevrangebyscore('key', 2, 3, function (err, members) {
  // callback called once the action has completed
// Using promises (NodeJS only)
kuzzle.memoryStorage.zrevrangebyscorePromise('key', 2, 3)
  .then(members => {
    // resolved once the action has completed

Callback response:

Copied to clipboard!
  { "member": "baz", "score": 3 },
  { "member": "bar", "score": 2 },
  { "member": "foo", "score": 1 }