access data in firestore QueryDocumentSnapshot collection flutter

284 views
Skip to first unread message

jorge munin

unread,
Sep 10, 2022, 7:02:08 PM9/10/22
to Firebase Google Group
I am trying to access the data from a subcollection in firestore.

I have a collection that looks like the imageFirestore collection.png

I can access the field name by doing 

name = snapshot.data()['name'] as String;

but how can I access the collection products and his fields. The collection products has a product with a field productName.

I want the product name because I want to display it in a ListTile I am already displaying the list name:list tile.png

The method where I get the data from the collection is this:Collection.png

Thanks in advance.

jorge munin

unread,
Sep 11, 2022, 9:55:14 AM9/11/22
to fireba...@googlegroups.com
I find out that read operations on Firestore are swallow so I have to do this is 2 queries. I am gonna find out now hot to do 2 or more queries in 1 stream

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/zLQKJ-Mg36g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/7175c4bf-ec0d-4685-9a1f-dd26182012e8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages