Skip to content

Delete Values

Description

This operation deletes specific elements from the set.

Method


Delete One Value

Backendless.Hive(hiveName).SetStore(keyName).deleteValue(value): Promise<number>;

Delete Multiple Values

Backendless.Hive(hiveName).SetStore(keyName).deleteValues(values[]): Promise<number>;

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
keyName Key name identifying a set. String value.
value A value that must be deleted from the set. Can be of any JavaScript data type.
values[] An array values that must be deleted from the set. Values can be of any JavaScript data type.

Return Value

The number of deleted values.

Examples


Delete One Value

The example below deletes one item 'Crossover'  from the 'cars' set.

await Backendless.Hive('transport').SetStore('cars').deleteValue('Crossover')

where:

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


Delete Multiple Values

The example below deletes two values '``Sedan``' and 'Crossover'  from the 'cars' set.

await Backendless.Hive('transport').SetStore('cars').deleteValues(['Sedan', 'Crossover'])

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