var entries = [
  {"field": "field1", "value": "foo"},
  {"field": "field2", "value": "bar"},
  {"field": "...", "value": "..."}

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

// Using promises (NodeJS only)
kuzzle.memoryStorage.hmsetPromise('key', entries)
  .then(status => {
    // resolved once the action has completed
JSONObject[] entries = new JSONObject[]{
  new JSONObject().put("field", "field1").put("value", "foo"),
  new JSONObject().put("field", "field2").put("value", "bar"),
  new JSONObject().put("field", "...").put("value", "...")

kuzzle.memoryStorage.hmset("key", entries, new ResponseListener<String>() {
  public void onSuccess(String status) {
    // callback called once the action has completed

  public void onError(JSONObject error) {

use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');

$entries = [
  ['field' => 'field1', 'value' => 'foo'],
  ['field' => 'field2', 'value' => 'bar'],
  ['field' => '...', 'value' => '...']

try {
  $status = $kuzzle->memoryStorage()->hmset('key', entries);
catch (ErrorException $e) {


Callback response:


Sets multiple fields at once in a hash.

[Redis documentation]

hmset(key, entries, [options], [callback])

keystringKey identifier
entriesarrayList of fields to add, with their value. Each entry is described by a JSON object containing the following properties:
field (field name), value (field's value)
optionsJSON ObjectOptional parameters


queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the MemoryStorage object to allow chaining.

Callback response

Resolves to a simple "OK" string.