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

// Using promises (NodeJS only)
kuzzle.memoryStorage.lpushPromise('key', ['foo', 'bar', 'baz'])
  .then(count => {
    // resolved once the action has completed
String[] items = new String[]{"foo", "bar", "baz"};

kuzzle.memoryStorage.lpush("key", items, 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()->lpush('key', ['foo', 'bar', 'baz']);
catch (ErrorException $e) {


Callback response:


Prepends the specified values to a list. If the key does not exist, it is created holding an empty list before performing the operation.

[Redis documentation]

lpush(key, values, [options], [callback])

keystringKey identifier
valuesarrayValues 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.