Skip to content

Delete Value(s)

Description

This operation deletes multiple values from a sorted set.

Method

DELETE

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]/sorted-set/[key]/values

where:

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

Request Headers

Content-Type: application/json:

where:

Argument                Description
Content-Type Must be set to application/json. This header is mandatory.

Request Body

A JSON array containing values to delete. Each value must be of the same JSON type as it is stored in the sorted set.

["stringValue1", numericValue2, {"someProp":someValue},....]

Response Body

A number of deleted values. Returns 0 if the values do not exist in the sorted set.

Example

The example below deletes the specified values( "Dave" and "Frank" ) from the sorted set.

curl --location --request DELETE "https://xxxx.backendless.app/api/hive/leaderboard/sorted-set/players/values" \  
        --header 'Content-Type: application/json' \  
        --data-raw '[  
            "Dave", "Frank"  
        ]']

where:

Argument                Description
leaderboard Name of a hive where the operation is performed.
players Key name identifying a sorted set for the operation.
"Dave", "Frank" Values to delete.

Codeless Reference
sorted_set_api_delete_values

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a sorted set.
values A list of values to delete from the specified sorted set. Each value must be of the same data type and structure as the one stored in the sorted set.

Returns the number of items deleted from the sorted set.

Consider the following Sorted Set storage:
sorted_set_api_example_all_blocks

The example below deletes the following values from the "players" sorted set: "John" and "Bobby".
sorted_set_api_example_delete_values

The sorted set will look as shown below after the Codeless logic runs.
sorted_set_api_example_delete_values_2