zrangebyscore

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.zrangebyscore('key', 2, 3, function (err, members) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.zrangebyscorePromise('key', 2, 3)
  .then(members => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.zrangebyscore("key", 2, 3, new ResponseListener<JSONObject[]>() {
  @Override
  public void onSuccess(JSONObject[] members) {
    // callback called once the action has completed
  }

  @Override
  public void onError(JSONObject error) {
  }
});
<?php

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $members = $kuzzle->memoryStorage()->zrangebyscore('key', 2, 3);
}
catch (ErrorException $e) {

}

Callback response:

[
  { "member": "foo", "score": 1 },
  { "member": "bar", "score": 2 },
  { "member": "baz", "score": 3 }
]

Returns all the elements in the sorted set at key with a score between min and max (inclusive). The elements are considered to be ordered from low to high scores.

[Redis documentation]


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

ArgumentsTypeDescription
keystringKey identifier
mindoubleMinimum score value (inclusive by default)
maxdoubleMaximum score value (inclusive by default)
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
limitarrayLimit the result set to a range of matching elements (similar to SELECT LIMIT offset, count in SQL).
Format: [<offset(int)>, <count(int)>]
null
queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the MemoryStorage object to allow chaining.


Callback response

Resolves to an array of matching members.