Skip to content Skip to sidebar Skip to footer

Delete Document By Getting Document Name In Cloud Firestore

Been working on finding a way to delete the clicked on document using React Native and Cloud Firestore. I can't figure out a way to get the document id and then use it in my code t

Solution 1:

Every time you push a TODO to todos, make sure to also include the document ID:

todos.push({
  id: doc.id,
  tips: doc.data().tips,
  date: doc.data().date,
  user: doc.data().user,
  like: doc.data().like
})

Then when you render a TODO, you include the ID in the rendering output of the eleent:

<Text onPress={() =>this.deletePost(styles.id)}>

Post a Comment for "Delete Document By Getting Document Name In Cloud Firestore"