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

// Using promises (NodeJS only)
kuzzle.memoryStorage.decrbyPromise('key', 42)
  .then(value => {
    // resolved once the action has completed
kuzzle.memoryStorage.decrby("key", 42, new ResponseListener<Long>() {
  public void onSuccess(int value) {
    // callback called once the action has completed

  public void onError(JSONObject error) {

use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');

try {
  $value = $kuzzle->memoryStorage()->decrby('key', 42);
catch (ErrorException $e) {


Callback response:


Decrements the number stored at key by a provided integer value. If the key does not exist, it is set to 0 before performing the operation.

[Redis documentation]

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

keystringKey identifier
valueintDecrement value
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 key value