SDK
SDK Javascript v5.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

ltrim #

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
queuablebooleanMake this request queuable or nottrue

Return value #

Returns the MemoryStorage object to allow chaining.


Callback Response #

Returns null if successful.

Usage #

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.ltrim('key', 1, 2, function (err) {
  // callback called once the action has completed
});
// Using promises (NodeJS only)
kuzzle.memoryStorage.ltrimPromise('key', 1, 2)
  .then(() => {
    // resolved once the action has completed
  });