简体   繁体   中英

How to work with query in firebase with flutter?

I want to create a query which contains all the documents in the free collection which have in the field list the value item2

Use this query in StreamBuilder and retrieve data through it.

stream: Firestore.instance.collection('free').snapshots()

In stream we can get all documents.

Finally we can get item by accessing first document.ie data[0].In the first document we will get ['list'] and in that list we will get the first item which is item 4.

snapshot.data[0]['list'][0]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM