Skip to content

Delete Key Value

Description

This operation deletes specific values from a list.

Method

Backendless.Hive(hiveName).ListStore(keyName).deleteValue(value, count): 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.
value Value to delete from the list. Can be of any JavaScript data type.
count Optional parameter. Defaults to 1. Identifies the number of duplicate items to delete from the list.

Return Value

The number of deleted items.

Example

The example below deletes 2 identical values 'Bob' from the 'blockList' list if they exist. At least 1 item and at most 2 duplicate items are deleted.

await Backendless.Hive('demoHive').ListStore('blockList').deleteValue('Bob', 2)

where:

Argument                Description
'demoHive' Name of a hive where the operation is performed.
'blockList' Key name identifying a list to delete values.
'Bob'  Value to delete.


Codeless Reference
list_api_delete_key_value

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a list.
value Value that must be deleted from the list.
count Specify the number of duplicate items to delete.

The number of deleted items.

Consider the following List storage:

list_api_example_get_values_2

The example below deletes one item "value2" from the list.
list_api_example_delete_key_value