hgetall

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

// Using promises (NodeJS only)
kuzzle.memoryStorage.hgetallPromise('key')
  .then(hash => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.hgetall("key", new ResponseListener<JSONObject>() {
  @Override
  public void onSuccess(JSONObject hash) {
    // callback called once the action has completed
  }

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

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $hash = $kuzzle->memoryStorage()->hgetall('key');
}
catch (ErrorException $e) {

}

Callback response:

{
  "field1": "value",
  "field2": "value",
  "...": "..."
}

Returns all fields and values of a hash.

[Redis documentation]


hgetall(key, [options], callback)

ArgumentsTypeDescription
keystringKey identifier
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to a JSON object containing the fields and values of a hash.