#Repost Removing multiple items using a dataset

I had written about this before and got no comments, I have a large database of items that I need to filter a dataset (Read and Write) before having them removed. I have tried using a loop to remove them with no success. Here is the code; Any ideas will be greatly helpful.

asyncfunctiondeleteall(){
letdealerid=local.getItem("itemId")
await$w('#dataset14').setFilter(wixData
.filter().contains("dealerId",dealerid));
letcount=$w("#dataset14").getTotalCount();
for(leti=0;i<count;i++){
$w("#dataset14").remove().then(()=>{
console.log(count)});}
$w("#dataset11").refresh()}