hmget

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.hmget('key', ['field1', 'field2', '...'], function (err, values) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.hmgetPromise('key', ['field1', 'field2', '...'])
  .then(values => {
    // resolved once the action has completed
  });
String[] fields = {"field1", "field2"};

kuzzle.memoryStorage.hmget("key", fields, new ResponseListener<String[]>() {
  @Override
  public void onSuccess(String[] values) {
    // callback called once the action has completed
  }

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

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $values = $kuzzle->memoryStorage()->hmget('key', ['field1', 'field2', '...']);
}
catch (ErrorException $e) {

}

Callback response:

[
  "field1's value",
  "field2's value",
  "..."
]

Returns the values of the specified hash’s fields.

[Redis documentation]


hmget(key, fields, [options], callback)

ArgumentsTypeDescription
keystringKey identifier
fieldsarrayList of fields to examine
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to an array containing the specified fields values.