My Firebase structure is as below. I'm using python to use firebase, and also I use Pyrebase.
I want to get a key, which looks like '288xxxxxx' from the value(busStopName). Can I get the answer in Pyrebase?
Thank you in advance...
My Firebase structure is as below. I'm using python to use firebase, and also I use Pyrebase.
I want to get a key, which looks like '288xxxxxx' from the value(busStopName). Can I get the answer in Pyrebase?
Thank you in advance...
The following should work, based on the documentation
searched_bus = db.child("asanbus").order_by_child("busStopName").equal_to("XYZ").get()
for bus in searched_bus.each():
print(bus.key())
Assumption: there is only one record corresponding to busStopname = "XYZ"
. If not the case, you may do:
searched_bus = db.child("asanbus").order_by_child("busStopName").equal_to("XYZ").limit_to_first(1).get()