Deletion of database contents

I have trying to figure out a javascript Onclick function that can delete all the contents in the database instead of selecting one by one at the contents manager. Anyone with an idea how this can be achieve?

You will be pleased to know that there is a function that removes all items from a collection.

Hello Anthony, I would like to have it as a Onclick button function on an admin only accessed page.
This is my code.

import wixData from 'wix-data';
wixData.truncate("confirm")
  .then( () => {
    console.log("All items removed");
  } )
  .catch( (err) => {
    let errorMsg = err;
  } );