3👍
✅
doc
is a DocumentSnapshot that has an id
property. Just add the document ID into each item object that you generate:
const promiseThemes = snapshot.docs.map(doc => {id: doc.id, ...doc.data());
Now you have an object with an id
property that you can use to delete the document.
Source:stackexchange.com