for example, I want to get the total number of users that offers "Laundry" services in android from firebase real time database
Asked
Active
Viewed 62 times
1
-
Does this answer your question? [How can I query and filter Firebase Realtime Database](https://stackoverflow.com/questions/48037766/how-can-i-query-and-filter-firebase-realtime-database) – BroscR Oct 18 '21 at 13:20
-
Your current data structure makes it easy to find the services offered by a specific user. It does not however make it easy to find the users offering a specific service. To allow that, you'll have to add an additional top-level data structure, where you start with the service as the key, and then add each user's UID under that. For more on this and examples, see https://stackoverflow.com/questions/40656589/firebase-query-if-child-of-child-contains-a-value and https://stackoverflow.com/questions/27207059/firebase-query-double-nested – Frank van Puffelen Oct 18 '21 at 13:27
-
alright, i'll look into those questions. thank y'all – help me Oct 18 '21 at 13:41
-
@FrankvanPuffelen your comment worked! thank you so much – help me Oct 18 '21 at 17:09