deleteAll
Overview
The deleteAll function deletes specified elements, or specified values (along with the keys) from a collection.
Syntax
To delete values along with the keys:
<collectionVariable>.deleteAll(<valuesList>);
(OR)
To delete elements:
<collectionVariable>.deleteAll(<elementsList>);
where,
Parameter | Data type | Description |
<collectionVariable> | COLLECTION | The variable from which key value pairs or elements will be deleted. |
<valuesList> | LIST | Values which will be deleted along with the keys. |
<elementsList> | LIST | Element which will be deleted. |
Examples
products = collection("Creator", "CRM", "Campaigns"); products.deleteAll({"CRM", "Campaigns"}); // deletes the specified elements from the collection
productVersion = collection("Creator" : 5, "CRM" : 2); productVersion.deleteAll({2}); // deletes the specified key along with its value from the collection