Skip to content

Intersection

Description

This operation finds and returns identical values between two or more sets.

Method

Backendless.Hive(hiveName).SetStore.intersection(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 containing identical values found between the primary set and all consecutive sets included in the operation. Each individual value is of the any data type.

Example

The example below finds and returns identical values found between the primary set (i.e. 'cars') and the secondary set (i.e. 'cars_2').

await Backendless.Hive('transport').SetStore.intersection(['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. Only identical values found between the primary set("cars") and the secondary set("cars_2") are included in the response.

set_api_example_sdks_diff_inter_union_output_2

Codeless Reference

set_api_intersection

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 storages:

set_api_example_sdks_diff_inter_union

The example below finds and returns identical values found between the primary set (i.e. "cars") and the secondary set (i.e. "cars_2").
set_api_example_intersection

The output will look as shown below after the Codeless logic runs. Only identical values found between the primary set("cars") and the secondary set("cars_2") are included in the response.

set_api_example_sdks_diff_inter_union_output_2