[Vuejs]-How get the id of an document from vuejs and firestore?

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.

Leave a comment