Skip to content

Intersection

Description

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

Method

POST

Endpoint URL

Important

Make sure to replace xxxx in the domain name in the request specification below to the one assigned to your application.

https://xxxx.backendless.app/api/hive/[hive-name]/set/action/intersection

where:

Argument                Description
[hive-name] Name of a hive where the operation is performed.

Request Headers

Content-Type:application/json

where:

Argument                Description
Content-Type Must be set to application/json. This header is mandatory.

Request Body

The request body must be a JSON array containing string values that identify the names of the specified sets:

["setname_1", "setname_2", ...]

Response Body

A JSON array containing identical values found between the primary set and all consecutive sets included in the operation. Each individual value is of the JSON 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").

curl --location --request POST "https://xxxx.backendless.app/api/hive/transport/set/action/intersection" \--header 'Content-Type: application/json' \--data-raw '["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