Skip to content

Length

Description

This operation counts the number of elements in the map 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]/map/[key]/length

where:

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

Request Headers

None.

Request Body

None.

Response Body

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.

curl --location --request GET "https://xxxx.backendless.app/api/hive/groceryStore/map/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