Choose where you’d like to start

deleteAll

Table of Contents

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,

ParameterData typeDescription
<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

Get Started Now

Execute