I'm trying to find a user by a value in an array. This is the structure of a user:
And I'm using this but it returns null:
FirebaseDatabase.getInstance().getReference().child("users")
.orderByChild("tokens")
.equalTo(from)
UPDATE:
I've tried Puff suggestion and this is my structure now:
The code I'm using is:
FirebaseDatabase.getInstance().getReference().child("users)
.orderByKey()
.equalTo(token)
But still I get null result.
UPDATE 2:
So what I'm trying to do is not possible. You can't create a query starting from parent and give in the child of child. As Puff said you can ONLY query direct reference, witch is not very useful in all cases. Still I managed to get what I wanted saving the value in another form, locally.
:(