简体   繁体   English

如何从 firebase 中获取带有字段值的数据?

[英]How to get data from firebase with field value?

I Want to get data from firebase as a field like category.means i want to get data Such in image Field category value is fashion so all items where field category value fashion data are retrive so which query i use for it anyone tell me?我想从 firebase 获取数据作为类别之类的字段。意味着我想获取图像中的数据 字段类别值是时尚的,因此所有字段类别值时尚数据的项目都被检索,所以我使用哪个查询有人告诉我?

I think you're looking for this query:我想你正在寻找这个查询:

FirebaseFirestore.instance
  .collection('users')
  .where('category', isEqualTo: 'fashion')
  .get()
  .then(...);

I highly recommend reading the FlutterFire documentation on filtering data , and keeping the reference documentation on the where method handy.我强烈建议阅读有关过滤数据的 FlutterFire 文档,并将where方法的参考文档放在手边。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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