pfmerge

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.pfmerge('key', ['key1', 'key2', '...'], function (err, status) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.pfmergePromise('key', ['key1', 'key2', '...'])
  .then(status => {
    // resolved once the action has completed
  });
String[] keys = new String[]{"key1", "key2", "..."};

kuzzle.memoryStorage.pfmerge('key', keys, new ResponseListener<Long>() {
  @Override
  public void onSuccess(int status) {
    // callback called once the action has completed
  }

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

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $status = $kuzzle->memoryStorage()->pfmerge('key', ['key1', 'key2', '...']);
}
catch (ErrorException $e) {

}

Callback response:

"OK"

Merges multiple HyperLogLog data structures into an unique HyperLogLog structure stored at key, approximating the cardinality of the union of the source structures.

[Redis documentation]


pfmerge(key, sources, [options], callback)

ArgumentsTypeDescription
keystringDestination key identifier
sourcesstringList of HyperLogLog source key identifiers
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to a simple "OK" string.