Android Firebase Query

I have this structure enter image description here Now I create a query like this:

DatabaseReference myRef = database.getReference("users"); myRef.equalTo("6991580","ci").addListenerForSingleValueEvent(new ... 

I was expecting a second node result. Then I get:

DataSnapshot {key = users, value = null}

So what is wrong with this request? or maybe I'm doing something wrong?

Best wishes and thanks for the reply.

+6
source share
2 answers

You need to tell Firebase which child property you want to order / filter:

 myRef.orderByChild("ci").equalTo("6991580").addListenerForSingleValueEvent(... 

Another ordering format is usually a misunderstood version. I would recommend just staying away from him.

+18
source

I had the same problem and solved it by changing the listener:

myRef.orderByChild("ci").equalTo("6991580").addChildEventListener(new ChildEventListener() {}

+1
source

All Articles