bulkRemove( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Removes a number of items from a collection.

The bulkRemove() method returns a Promise that resolves after the items have been removed from the specified collection. The Promise is rejected if the current user does not have "delete" permissions for the collection. If the delete permissions for the collection are assigned to Item's creator, the only items that are deleted are those for which the current user is the owner. All other items are skipped.

Calling the bulkRemove() method triggers the beforeRemove() and afterRemove() hooks for each item that is deleted if the hooks have been defined.

Notes:

  • The bulkRemove() method also clears multiple-item reference fields for items in collections referenced by the specified items. For example, suppose you have a Movies collection with an Actors field that contains multiple references to items in a People collection. Removing items in the Movies collection also clears the data in the corresponding multiple-item reference fields in the People collection.
  • Bulk operations are limited to 1000 items per method call.
Permissions
Write Data Items
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
dataCollectionIdstringRequired

ID of the collection to which the items belong.


itemIdsArray<string>

IDs of the items to remove. The array must contain at least one item. Passing an empty array returns an error.


optionsWixDataOptions

Options to use when processing this operation.

Returns
Return Type:Promise<WixDataBulkResult>
Did this help?