I have an array of ids which in my case represent documents inside a collection, my goal is to remove all of those those docs inside a collection according to id's inside an array my question is should I do a for loop on the doc delete function ? or is there a function that allows you to delete multi docs according
const DeletAccount = async (sharedId: string, clientsIds: string[]) => {
const batch = writeBatch(db);
clientsIds.forEach((docId) => {
batch.delete(doc(db, 'col1', docId));
});
// Commit the batch
await batch.commit();
// Delete col2
await deleteDoc(doc(db, 'col2', sharedId));
// Delete Main doc col3
await deleteDoc(doc(db, 'col3', currentUser.uid));
}
const toDelete = ['sdferwer32423asd','Pasdas34234235', 'aMNsdasd21312223232']
to a preference like an array of ids in my case ?