firebase delete document code example
Example 1: firebase storage javascript delete document
var fileLocation = "Images/Dogs/myDog.jpg"
Firebase.storage().ref().child(fileLocation).delete();
Example 2: how to delete firebase collection
this.db
.collection('cart')
.get()
.toPromise()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => {
doc.ref.delete();
});
});
Example 3: firestore javascript delete document
var docRef = Firebase.firestore().collection("Rooms").doc("bsYNIwEkjP237Ela6fUp").collection("Messages");
docRef.doc("lKjNIwEkjP537Ela6fhJ").delete();