Open ruffy2 opened 4 years ago
I have encountered the same issue. I noted that the pattern that worked for me, when querying an empty database, had the following term attached:
.limit_to_first(number)
Even though it didn't make much sense for me to limit the result of the query giving me errors, I put the term there with a high enough number, and it worked. Hope this answer can help someone dealing with the same problem in the future!
Complete code for reference:
db = pyrebase.initialize_app(pyrebase_config).database()
response = (
db.child(key)
.order_by_child("some_firebase_key")
.equal_to(comparison_key)
.limit_to_first(number)
.get()
)
I'm querying my db and not getting any response back. I am using the following query:
response_object = db.child(key).order_by_child(child).equal_to(id).get()
I want to check to see if I get a response. If I do, do something. If not, say I could not find a match:
I have used this pattern before successfully but this time I am getting an IndexError. Any idea what is wrong? Thanks for the help