0

I want to check relevant user_id already exists in the user collection.

const snapShot = await FirebaseFirestore.instance.collection('user').document(user.uid).get();

if (snapShot.exists){
  navigation.navigate('dashboard');   
}

But the error message appear as

"[Unhandled promise rejection: ReferenceError: Can't find variable: FirebaseFirestore]"

I am doing this in React Native Expo App. Can anyone let me know about the solution?

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
ab_404
  • 61
  • 7
  • Have a look at this stackoverflow [link1](https://stackoverflow.com/questions/61465155/how-to-check-if-a-document-exists-in-a-firestore-collection) & [link2](https://stackoverflow.com/questions/46880323/how-to-check-if-a-cloud-firestore-document-exists-when-using-realtime-updates) – Sathi Aiswarya Nov 07 '22 at 07:43

0 Answers0