this might work
function clear() {
//let user = wixUsers.currentUser;
//let userId = user.id;
// const itemId = event.context.itemId; // this is the item in the repeater assuming that the button is in the repeater.
wixData.query("yourdatabase") // get the item from the database collection.
.eq("userId")// if any specific field ("userId", userId)
.find()
.then((results) => {
removeItems(results.items);
console.log(removeItems);
});
}
async function removeItems(items) {
items.forEach(async (item, i) => {
await wixData.remove("yourdatabase", items[i]._id);
console.log(removeItems);
});
}