Please Help! Delete Specific Records in a Collection?

Thanks for the response but I am still having no luck. I have no clue as to why. I have entered this to test it, what am I missing?


import wixData from ‘wix-data’ ;

export function dropdownName_change ( event ) {
if ( $w ( “#dropdownName” ). value !== ‘’ ) {
$w ( “#btnDelete” ). enable ();
}
}

export function btnDelete_click ( event ) {
wixData . query ( “Prospects” )
. eq ( “email” , $w ( “#dropdownName” ). value )
. limit ( 1000 )
. distinct ( “_id” )
. then ( results => {
return wixData . bulkRemove ( “Prospects” , results . items );
})
. then (() => {
refreshRepeater ()
})
. catch (( err ) => {
console . log ( err );
$w ( “#txtMessage” ). text = “An unexpected error has occurred.” ;
});
}

function refreshRepeater ( ) {
let newFilter = wixData . filter ();
const currentItem = $w ( “#dataset2” ). getCurrentItem ();
$w ( ‘#dataset2’ ). setFilter ( newFilter )
. then (() => {
$w ( “#dropdownName” ). value = ‘’ ; // reset options
$w ( “#table1” ). refresh (); // reset options
$w ( “#btnDelete” ). disable (); // reset button
})
}