
Now I'm trying to do all the children with a categoryvalueshop
I tried this code
Firebase ref = new Firebase("https://top-africa.firebaseio.com/businesses/);
ref.orderByChild("category").equalTo("shop");
ref.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
Object ob = dataSnapshot.getValue();
System.out.println("There are " + dataSnapshot.getKey() + " blog posts==" + dataSnapshot.getValue());
}
});
but when I look at the magazine, it prints all 10 children, whereas I believe that I would get only one, because there category shopwas only one value.
I don’t know what I am missing. Could you help me solve the problem?
source
share