incrbyfloat

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.incrbyfloat('key', -3.14159, function (err, value) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.incrbyfloatPromise('key', -3.14159)
  .then(value => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.incrbyfloat("key", -3.14159, new ResponseListener<Double>() {
  @Override
  public void onSuccess(double value) {
    // callback called once the action has completed
  }

  @Override
  public void onError(JSONObject error) {
  }
});
<?php

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $value = $kuzzle->memoryStorage()->incrbyfloat('key', -3.14159);
}
catch (ErrorException $e) {

}

Callback response:

38.85841

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

[Redis documentation]


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

ArgumentsTypeDescription
keystringKey identifier
valuedoubleIncrement value
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Available options:

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the MemoryStorage object to allow chaining.


Callback response

Resolves to a floating point number containing the updated key value