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

[Redis documentation]

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

Arguments Type Description
key string Key identifier
start int Starting position of the range of items to keep (inclusive)
stop int Ending position of the range of items to keep (inclusive)
options JSON Object Optional parameters
callback function Callback


Option Type Description Default
queuable boolean Make this request queuable or not true

Return value

Returns the MemoryStorage object to allow chaining.

Callback Response

Returns null if successful.


Copied to clipboard!

kuzzle.memoryStorage.ltrim("key", 1, 2, new ResponseListener<Void>() {
  public void onSuccess(Void v) {
    // callback called once the action has completed

  public void onError(JSONObject error) {