Unknown SDK

sunion

Returns the union of sets of unique values.

[Redis documentation]

Arguments

Copied to clipboard!
sunion(keys, [options]);

Arguments Type Description
keys
string[]
List of set keys
options
object
Optional query arguments

options

The options arguments can contain the following option properties:

Property Type (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

Copied to clipboard!
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);
}