Delete Last¶
Description¶
This operation deletes values from the end of the list and returns them in the response.
Method¶
Backendless.Hive(hiveName).ListStore(keyName).deleteLast(count): Promise<values[]>;
where:
Argument | Description |
---|---|
hiveName |
Name of a hive where the operation is performed. String value. |
keyName |
Key name identifying a list. String value. |
count |
Optional parameter, defaults to 1. Specify the number of elements to delete from the end of the list. |
Return Value¶
An array containing deleted values.
Example¶
The example below deletes 2
values from the end of the 'fruits'
list.
await Backendless.Hive('demoHive').ListStore('fruits').deleteLast(2)
where:
Argument | Description |
---|---|
'demoHive' |
Name of a hive where the operation is performed. |
'fruits' |
Key name identifying a list to delete values. |
You can also use this operation without the count
parameter. When the count
parameter is not used, then this operation always deletes the last item in the list.
await Backendless.Hive('demoHive').ListStore('fruits').deleteLast()
where:
Argument | Description |
---|---|
'demoHive' |
Name of a hive where the operation is performed. |
'fruits' |
Key name identifying a list. |
Codeless Reference
¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key name |
Key name identifying a list. |
position: last |
Instructs Hive to delete item(s) at the end of the list. |
count |
Specifies the number of items to delete. |
Returns a list containing deleted values.
Consider the following List storage:
The example below deletes the last value in the list: