Search.../

deleteCollection( )

Developer Preview

Deletes a collection.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function deleteCollection(_id: string): Promise<void>

deleteCollection Parameters

NAME
TYPE
DESCRIPTION
_id
string

ID of the collection to delete.

Returns

Return Type:

Promise<
void
>

Was this helpful?

deleteCollection example

Copy Code
1import { products } from 'wix-stores.v2';
2
3 async function deleteCollection(id) {
4 try {
5 const result = await products.deleteCollection(id);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13