Skip to content

Length

Description

This operation counts and returns the number of values in the list.

Method

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

where:

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

Return Value

The total number of values in the list.

Example

The example below returns the total number of values in the 'fruits' list.

await Backendless.Hive('demoHive').ListStore('fruits').length()

where:

Argument                Description
'demoHive' Name of a hive where the operation is performed.
'fruits' Key name identifying a list to get the total number of values.


Codeless Reference
list_api_get_key_items_count

where:

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

Returns the total number of values in the list.

Consider the following List storage:

list_api_example_get_values_2

The example below counts the number of items in the demoList:

list_api_example_get_key_items_count