0
I am trying to sort my search by date, however I have to look for a value and it is not allowed to use two orderByChild. I need to either find the name passed by the search variable name or sort by the date of birth. Could someone help?
referenciaFirebase.child("cliente").orderByChild("nome").equalTo(buscaNome).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) {
final String nomeCliente = postSnapshot.child("nome").getValue(String.class);
final String data_nascimento = postSnapshot.child("data").getValue(String.class);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
Did you try using the Query class ? If not, try using it instead of referenceFirebase
– Eduardo Rafael Moraes
Yes, but it was the same
– Souza97