0

i am trying to display all this shops inventory data and filter by category/name/price/etc..

  1. 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?
  2. is their better way to get all this shops data and filter using category /product name/price/etc...

Database

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Lahiru
  • 47
  • 4
  • There is really not a lot of information to go on here. E.g. "with large user data that way can cause performance?" What is "large" here and what would be the performance problem you mention? Did you test this already? Can you show us the [code from that test](http://stackoverflow.com/help/mcve)? On what type of device did you test (memory, cpu, bandwidth)? What performance did you get? And what did you expect/aim for? – Frank van Puffelen Jan 06 '23 at 02:36
  • as a example : lets say i have 10 shops inventory data is stored in real time database and total 10 000+ product list so firebase provide orderbychild() to quay filter data if i can use this like this (ref.child("Shop1").orderByChild("Product_name").startAt(searchText) .endAt("${searchText}\uf8ff") ) this is super quick and easy i am asking is their a way to get all the 10shops data using order by child directly with out pushing it to an array – Lahiru Jan 06 '23 at 02:52
  • 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 perform recursive searches on all nodes under there. So, nope... you'll have to (possibly additionally) store the data in a flat list if you want to search across all shops with one query. Also see https://stackoverflow.com/questions/27207059/firebase-query-double-nested – Frank van Puffelen Jan 06 '23 at 04:46

1 Answers1

0

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 Firebase Query Double Nested

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807