Reputation: 99
I have check pyrebase and i want to search for the IDNumber of each user.
i have tried using
db.child("Users").order_by_child("IDNumber").equal_to(2011445392).get()
But it gave me an error related to index not defined. Is there a way to search for IDNumber similar to SQL?
Upvotes: 0
Views: 978
Reputation: 58
Your query is correct. The error about index not defined occurs because you haven't set any rule on IDNumber
.
You need to configure rules on your indexes like this :
{
"rules": {
"Users": {
".indexOn": ["IDNumber"]
}
}
}
https://firebase.google.com/docs/database/security#section-defining-indexes
Upvotes: 1