Printing from firestore if one of my data field matches a condition?

  1. Summary of my problem

I just want to know if there is some built in functionality which could help me do this?

If I understand well you are looking for a way to make a query to your database and select only specific documents where the uid field matches the current user’s one.

In the cloud_firestore package documentation, assuming you are using this package, there is an example code which could be adapted to your requirement.

Let’s say you have a userId variable holding the current users’s uid in your flutter client code, then you could print all the description of that user’s documents with the following query:

    .where("uid", isEqualTo: userId)
    .listen((data) =>
        data.documents.forEach((doc) => print(doc["description"])));


1 Like

Yes! That is what I needed!
Thanks a lot!

1 Like