0
I have an object where it is possible to add a list of addresses in the address field, the goal is to list the objects according to the neighborhoods where the objects reside.
Object:
public class Suspeito implements Serializable {
private String id;
private String foto;
private String nome;
private String apelido;
private String data_nascimento;
private String num_documento;
private String tipo_documento;
private String mae;
private String pai;
private String antecedentes;
private ArrayList<Endereco> endereco;
private String anotacoes;
}
Query:
consulta = firebaseReferencia.child("Suspeitos").child("endereco")
.orderByChild("bairro")
.equalTo(txt_bairro.getText().toString().toUpperCase());
The query is returning null.
Try
.child("Suspeitos").orderByChild("endereco/bairro")
– Rosário Pereira Fernandes
I tried to
.child("Suspeitos").orderByChild("endereco/0/bairro")
and returns the expected results based on this node, however how can I check the other address nodes?– Ronaldo Nunes