Skip to content

Union

Description

This operation creates a union of unique values from the specified sets. A union is a set made by combining unique elements of two or more sets.

Method

Backendless.Hive(hiveName).SetStore.union(keyNames): Promise<values[]>;

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
keyNames An array containing key names each identifying a set. Must be an array of string values.

Return Value

An array of unique values found in specified sets. Every element can be of any data type.

Example

The example below returns unique values found in the following sets: 'cars' and 'cars'.

await Backendless.Hive('transport').SetStore.union(['cars', 'cars_2'])

where:

Argument                Description
'transport' Name of a hive where the operation is performed.
['cars', 'cars_2'] An array of key names each identifying a set containing multiple values.

Contents Of Specified Sets

set_api_example_sdks_diff_inter_union

Response

The output will look as shown below after this operation runs.

set_api_example_sdks_diff_inter_union_output_3

Codeless Reference

set_api_union

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key names A list containing key names identifying unique sets.

Returns a list of identical values derived from multiple sets.

Consider the following Set storage:
set_api_example_sdks_diff_inter_union

The example below returns unique values found in the following sets: 'cars' and 'cars_2'.
set_api_example_union

The output will look as shown below after the Codeless logic runs.

set_api_example_sdks_diff_inter_union_output_3