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);

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
keyNames A set containing key names each identifying a set. Must be a set 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_2".

Set<String> keyNames = new HashSet<>();
keyNames.add( "cars" );
keyNames.add( "cars_2" );

Backendless.Hive("transport").SetStore().union(keyNames);

where:

Argument                Description
"transport" Name of a hive where the operation is performed.
keyNames A set 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