Skip to content

Length

Description

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

Method

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

where:

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

Return Value

The total number of items stored in the specified map.

Example

The example below returns the total number of items stored in the 'fruits' map.

await Backendless.Hive('groceryStore').MapStore('fruits').length()

where:

Argument                Description
'groceryStore' Name of a hive where the operation is performed.
'fruits' Key name identifying a map.

Codeless Reference

map_api_get_keys_count

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a map.

Returns the total number of items stored in the specified map.

Consider the following Map storage:
map_apI_example_map_store

The example below counts the number of values in the "fruits" map:

map_api_example_get_keys_couint

The output will look as shown below after the Codeless logic runs.
sorted_set_api_example_get_key_values_count._2