I want to fetch all the data from password_entries if the user_id is "BED3wChei4NEiDfQP72atUz2NU43"
How can I perform the same.
1 Answer
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());
});
4 Comments
tr1via
I am getting issue in getDocuments(). The method 'getDocuments' isn't defined for the type 'Query'. Try correcting the name to the name of an existing method, or defining a method named 'getDocuments'.
Or Nakash
@tr1via I edited the answer - use the new method
tr1via
Nakesh It worked. Thanks :)
FirebaseFirestore.instance .collection('password_entries') .where('user_id', isEqualTo: 'BED3wChei4NEiDfQP72atUz2NU43') .get() .then((value) => print(value.docs[0].data()));Or Nakash
@tr1via glad I could help! good week :)
