Skip to content

Length

Description

This operation counts the number of elements in the set and returns the total.

Method

GET

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/[key]/length

where:

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

Request Headers

None.

Request Body

None.

Response Body

The number of items stored in the set

Example

The example below returns the number of items stored in the cars set.

curl --location --request GET "https://xxxx.backendless.app/api/hive/transport/set/cars/length"

where:

Argument                Description
transport Name of a hive where the operation is performed.
cars Key name identifying a set.

Codeless Reference

set_api_get_key_items_count

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 the number of items stored in the set.

Consider the following Set storage:

set_api_example_all_blocks

The example below returns the number of items stored in the "cars" set.
set_api_example_get_key_items_count

The logic produces the following output:

set_api_example_get_key_items_count_2