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

// Using promises (NodeJS only)
kuzzle.memoryStorage.lpushxPromise('key', 'foo')
  .then(count => {
    // resolved once the action has completed
kuzzle.memoryStorage.lpushx("key", "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()->lpushx('key', 'foo');
catch (ErrorException $e) {


Callback response:


Prepends the specified value to a list, only if the key already exists and if it holds a list.

[Redis documentation]

lpushx(key, value, [options], [callback])

keystringKey identifier
valuearrayValue to add at the beginning of 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 updated number of items in the list.