SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

sunion #

Returns the union of sets of unique values.

[Redis documentation]

Arguments #

sunion(keys, [options]);

ArgumentsTypeDescription
keys
string[]
List of set keys
options
object
Optional query arguments

options #

The options arguments can contain the following option properties:

PropertyType (default)Description
queuable
boolean (true)
If true, queues the request during downtime, until connected to Kuzzle again

Resolve #

Resolves to the result of the union between the provided sets.

Usage #

try {
  await kuzzle.ms.sadd('set1', ['a', 'b', 'c']);
  await kuzzle.ms.sadd('set2', ['d', 'e', 'f']);
  await kuzzle.ms.sadd('set3', ['g', 'h', 'i']);
  // Prints: [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' ]
  console.log(await kuzzle.ms.sunion(['set1', 'set2', 'set3']));
} catch (error) {
  console.error(error.message);
}