0

So I am trying to load random queries from my Database, and am currently using the method, where when a node is added, it loads the current count, then adds one and sets the new nodes index as the current count + 1. However my problem is that my program uses a tiered approach where users can move up to new 'Levels' and load people their level (Showed by the 1, 2, and 4). Right now I have it remove the user from the current level and deduct the count, then do the adding procedure to the next one. However the only problem now is that there is no user at that index at the 'Level' they just left. Any help would be appreciated.

Database

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Tyler Rutt
  • 65
  • 1
  • 8
  • show some code, please, what have you tried? – serg_zhd May 20 '20 at 16:36
  • This example - https://stackoverflow.com/questions/40765613/get-random-child-from-firebase-database – Tyler Rutt May 20 '20 at 16:40
  • It’s a good idea to include code and structures as *text*, not links and images. That way, if they are needed in an answer, they can be copied and pasted. To get your Firebase structure, use the Firebase console->Export JSON and copy and paste a snippet of your structure. Lastly, images are not searchable which may prevent future readers from locating the question. – Jay May 20 '20 at 17:34
  • based on the question there was a user at level 3 and was moved to another level, so now there is no level 3. What's the problem with that? Also your question states your doing a Random Query and there are no queries in the question... and more importantly, what exactly is a 'random query' and what are you attempting to query for? – Jay May 20 '20 at 17:36

0 Answers0