Getting random node via matching number from firebase realtime db

35 views
Skip to first unread message

Calvin Lin

unread,
Mar 8, 2023, 2:31:13 PM3/8/23
to Firebase Google Group
What I intended to do: Extracting node that contains matching *ShopNo*. This matching ShopNo: I get by extracting the total amount of shops I have in my DB, followed by randomizing a value from the total amount of shops and extracting the node that contains the same ShopNo.
What I got: I managed to extract the value of total amount of shops in my DB and also managed to randomize a value from the total amount of shops. But when I tried to query the database, I get nothing in return. I tried catching the error but I couldnt at all as there is no error in my terminal.
At first, I tried to randomize a node but I failed at it. So I decided to get a random node by doing this method. But as this is my first time using firebase and my knowledge is not as good as the pros out there, I been stuck on this issue for almost a month already even though I search how to do via documentation/forum. Would appreciate if anyone can help me on this.
Reply all
Reply to author
Forward
0 new messages