can some one explain how can i delete collection in firebase/firestore using v9 using reactjs
firestore()
.collection('rate')
.get()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => {
doc.ref.delete();
});
this code i am using in v8 i need same thing in v9
const q = query(collection(db, `${udata.id}`));
const querySnapshot = await getDocs(q);
querySnapshot.forEach((doc) => {
// doc.data() is never undefined for query doc snapshots
console.log(doc.data());
});
already try this but this code only read data this can't allow me to delete so can some one tell me how to do it