lrange

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.lrange('key', 0, 1, function (err, values) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.lrangePromise('key', 0, 1)
  .then(values => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.lrange("key", 0, 1, new ResponseListener<String[]>() {
  @Override
  public void onSuccess(String[] values) {
    // callback called once the action has completed
  }

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

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $values = $kuzzle->memoryStorage()->lrange('key', 0, 1);
}
catch (ErrorException $e) {

}

Callback response:

[
  "foo",
  "bar"
]

Returns the list elements between the start and stop positions (inclusive).

[Redis documentation]


lrange(key, start, stop, [options], callback)

ArgumentsTypeDescription
keystringKey identifier
startintStart position
stopintEnd position
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to an array of retrieved values.