Skip to content

Delete Value

Description

This operation deletes specific values from a list.

Method

Backendless.Hive(hiveName).ListStore(keyName).deleteValue(value, count);

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 data type.
count Optional parameter. Identifies the number of duplicate items to delete from the list. Defaults to 1.

Return Value

The number of deleted values. 0 if the specified key cannot be not found.

Example

The example below deletes 2 identical values of "Apple" from the "fruits" list.

Backendless.Hive("groceryStore").ListStore("fruits").deleteValue("Apple", 2);

where:

Argument                Description
"groceryStore" Name of a hive where the operation is performed.
"fruits" Key name identifying a list.
"Apple" Value to delete from the list.

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_delete_key_value_2

The example below deletes 2 identical values "Apple" from the "fruits" list, since the count parameter is set to 2.
list_api_example_delete_key_value

The list will look as shown below after the Codeless logic runs:

list_api_example_delete_key_value_3