I have a problem:
I would like to create a firebase query using twice the orderByChild() condition
First condition: compare a field
Second condition: order the elements by a specific field.
This is an example of the query that I would doing:
ref.orderByChild("id").equalTo("1").orderByChild("name").addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot d : dataSnapshot.getChildren()) {
Model m = d.getValue(Model.class);
}
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});
If I try to use this query the app gets crashed. It's possible to create this type of query in Firebase?
Thanks in advance.