英文:
Firebase Flutter: how to quay Real time database nested data list
问题
I am trying to display all this shop's inventory data and filter by category/name/price/etc..
- 我可以通过使用
orderbyChild("Shop")
将所有数据推送到列表中并显示/过滤数据,但是对于大量用户数据,这种方式可能会导致性能问题? - 有没有更好的方法来获取所有这些商店的数据并使用类别/产品名称/价格等进行筛选?
英文:
i am trying to display all this shops inventory data and filter by category/name/price/etc..
- i can do this by using
orderbyChild("Shop")
and push all data in
to list and display/filter data but with large user data that
way can cause performance? - is their better way to get all this shops data and filter using
category /product name/price/etc...
答案1
得分: 0
Firebase Realtime Database查询会在查询路径下的每个直接子节点下查找值。它们不会在所有子节点中递归搜索。因此,如果您想要跨所有商店进行搜索,您可能还需要将数据存储在一个扁平列表中。
另请参阅 https://stackoverflow.com/questions/27207059/firebase-query-double-nested
英文:
Firebase Realtime Database queries look for values at a fixed path under each direct child node of the path that you query. They don't recursively search on all nodes under there. So, if you want to search across all shops, you'll have to (possibly additionally) store the data in a flat list.
Also see https://stackoverflow.com/questions/27207059/firebase-query-double-nested
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论