Home > Net >  Firestore database query issue
Firestore database query issue

Time:05-29

I want to fetch all the data from password_entries if the user_id is "BED3wChei4NEiDfQP72atUz2NU43" How can I perform the same.

Firestore screenshot

CodePudding user response:

You can use the following method:

FirebaseFirestore.instance
  .collection('password_entries')
  .where('user_id ', isEqualTo: "BED3wChei4NEiDfQP72atUz2NU43")
  .get()
  .then((checkSnapshot) {
    // Document found - do something with it
    print(checkSnapshot.docs[0].data());
  });
  • Related