I have following Firebase Realtime Database structure.
I want to search a game with inviteCode = 271429. There are multiple categories, so I don't have a way to know if this particular invite code will fall under Maths.
I tried using .orderByChild() but that doesn't work on child of child. It works only if I known that I need to look in Maths.
I tried to look for a way if I could only get keys of 'games' and then I could loop in those keys looking for the code. I ended up finding shallow but it seems it is available for REST only. I am trying to implement this in Flutter.
I don't want to download the complete data and then search because the data size can be large.
Please advise what is the best possible solution to query such a database structure. And also advise if I should improve the database structure, and if so please advise keeping in mind that need to limit the number of calls to database to avoid excessive data calls because I believe Firebase charges you based on it.
Thank you in advance.