Skip to content

Length

Description

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

Method

Backendless.Hive(hiveName).SetStore(keyName).length(): Promise<number>;

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
keyName Key name identifying a set. String value.

Return Value

The number of items stored in the set

Example

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

await Backendless.Hive('transport').SetStore('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