Skip to content

Delete Values

Description

This operation deletes specific elements from the set.

Method

Backendless.Hive(hiveName).SetStore(keyName).delete(values);

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
keyName Key name identifying a set. String value.
values  A set of values to delete from the set. Values can be of any data type.

Return Value

The number of deleted items. Otherwise, returns 0 if the specified values do not exist.

Example

Delete Multiple Values

The example below deletes the "Sedan" and "Crossover" items from the  set.

Set<Object> keyNames = new HashSet<>();
keyNames.add( "Sedan" );
keyNames.add( "Crossover" );

Backendless.Hive("transport").SetStore("cars").delete(keyNames);

where:

Argument                Description
"transport" Name of a hive where the operation is performed.
"cars" Key name identifying a set.

Codeless Reference

set_api_delete_items

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a set.
items A list of items that must be deleted from the set.

Returns the number of deleted values.

Consider the following Set storage:
set_api_example_all_blocks

The example below deletes two items "Sedan" and "Crossover" from the "cars" set:
set_api_example_delete_items


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