import { doc, deleteDoc } from "firebase/firestore";
await deleteDoc(doc(db,"collectionName","documentId")
//ex.. await deleteDoc(doc(db,"posts","2"))
xxxxxxxxxx
db.collection("cities").doc("DC").delete().then(() => {
console.log("Document successfully deleted!");
}).catch((error) => {
console.error("Error removing document: ", error);
});
xxxxxxxxxx
// define document location (Collection Name > Document Name > Collection Name >)
var docRef = Firebase.firestore().collection("Rooms").doc("bsYNIwEkjP237Ela6fUp").collection("Messages");
// delete the document
docRef.doc("lKjNIwEkjP537Ela6fhJ").delete();