firebase delete collection firestore code example
Example 1: how to delete firebase collection
this.db
.collection('cart')
.get()
.toPromise()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => {
doc.ref.delete();
});
});
Example 2: firestore delete document by id
const res = await db.collection('cities').doc('DC').delete();