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 know 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.
What is the best possible solution to query such a database structure? Should I improve the database structure? Keep in mind the need to limit the number of calls to database to avoid excessive data calls because I believe Firebase charges based on it.