ltrim

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

// Using promises (NodeJS only)
kuzzle.memoryStorage.ltrimPromise('key', 1, 2)
  .then(status => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.ltrim("key", 1, 2, new ResponseListener<String>() {
  @Override
  public void onSuccess(String status) {
    // callback called once the action has completed
  }

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

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $status = $kuzzle->memoryStorage()->ltrim('key', 1, 2);
}
catch (ErrorException $e) {

}

Callback response:

"OK"

Trims an existing list so that it will contain only the specified range of elements specified.

[Redis documentation]


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

ArgumentsTypeDescription
keystringKey identifier
startintStarting position of the range of items to keep (inclusive)
stopintEnding position of the range of items to keep (inclusive)
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the MemoryStorage object to allow chaining.


Callback response

Resolves to a simple "OK" string.