bulkDeleteMany function didnt working

I want to delete all objects of a specific class of the database, but when I executed it as follows, an error appears saying that it is a function that does not exist.

Uncaught (in promise) TypeError: Moralis.bulkDeleteMany is not a function
at HTMLButtonElement.destroyData (main.js:160:11)

this is my code

async function destroyData (classNameOfDb){

web3=await Moralis.enableWeb3();

let ToDelete = [{filter: {}}]

Moralis.bulkDeleteMany(classNameOfDb, ToDelete);

}

I think they are only accessible through the cloud functions. Try to create a cloud function with bulkDeleteMany and see if that helps.

1 Like