0

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

Firestore screenshot

1 Answer 1

2

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());
  });
Sign up to request clarification or add additional context in comments.

4 Comments

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'.
@tr1via I edited the answer - use the new method
Nakesh It worked. Thanks :) FirebaseFirestore.instance .collection('password_entries') .where('user_id', isEqualTo: 'BED3wChei4NEiDfQP72atUz2NU43') .get() .then((value) => print(value.docs[0].data()));
@tr1via glad I could help! good week :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.