sdiff

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

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

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

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

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

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

}

Callback response:

[
  "diff value1",
  "diff value2",
  "..."
]

Returns the difference between the set of unique values stored at key and the other provided sets.

[Redis documentation]


sdiff(key, keys, [options], [callback])

ArgumentsTypeDescription
keystringKey identifier to compare
keysarraylist of set keys to compare with the set stored at key
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the MemoryStorage object to allow chaining.


Callback response

Resolves to an array of differences.