// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.lrem('key', 1, 'foo', function (err, count) {
  // callback called once the action has completed

// Using promises (NodeJS only)
kuzzle.memoryStorage.lremPromise('key', 1, 'foo')
  .then(count => {
    // resolved once the action has completed
kuzzle.memoryStorage.lrem("key", 1, "foo", new ResponseListener<Long>() {
  public void onSuccess(int count) {
    // callback called once the action has completed

  public void onError(JSONObject error) {

use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');

try {
  $count = $kuzzle->memoryStorage()->lrem('key', 1, 'foo');
catch (ErrorException $e) {


Callback response:


Removes the first count occurences of elements equal to value from a list.

[Redis documentation]

lrem(key, count, value, [options], [callback])

keystringKey identifier
countintNumber of occurences of the value to remove
valuestringValue to be removed from the list
optionsJSON ObjectOptional parameters


queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the MemoryStorage object to allow chaining.

Callback response

Resolves to an integer containing the number of removed elements.