0

this is my firebase database

I want to get all route_number(example:"rt45") which contains stops(example:"hapur chungi").

i need a firebase query in java which returns all routenumber which have "hapur chungi" and "lal kaun" as their stops The stops names are variable and user may need result for "hapur chungi" and "mohan nagar" as their stops

Code after getting the first solution i got the correct output but for that i have to click the button twice to load the data. the code i have used after reporting my initial problem but now i have to click button twice to get output

  • Sounds like you're looking to use a Firebase query, which allows you to select nodes that have specific child values. The main problem with that is that it doesn't scale well, since the node *name* is dynamic in your scenario. For on why this is, and how to model this data to allow the use-case, see https://stackoverflow.com/questions/40656589/firebase-query-if-child-of-child-contains-a-value – Frank van Puffelen Feb 20 '20 at 21:16
  • 1
    i found it very useful but a problem arises now that i have to click the button twice in order to retrieve data, when i click the button once it doesnot show any data but when i click it again it shows accurate output – tracker exclusive Feb 20 '20 at 21:27
  • i have added the code which i used after Frank_van provided the solution – tracker exclusive Feb 20 '20 at 21:46
  • That sounds like a related, follow-up problem. I recommend opening a new question and showing the [minimal, complete/standalone code + JSON that anyone of us can run to reproduce the problem](http://stackoverflow.com/help/mcve). – Frank van Puffelen Feb 20 '20 at 23:13

0 Answers0