i'm trying to filter the data that i have in a database in firebase. I have a very simple structure of data like this.
{
"articulos" : {
"-LHYw-qz8fiTSg03TuYS" : {
"descripcion" : "refgre",
"fabricante" : "gerg",
"iva" : "21%",
"margen" : "23",
"nombre" : "greerfg",
"preciocompra" : "3213",
"preciocompraiva" : "12312",
"precioventa" : "323",
"precioventaiva" : "23",
"ref" : "4greg"
},
"-LHYwfIIoN46cjlF3VTR" : {
"descripcion" : "gdfgdfg",
"fabricante" : "dfgdf",
"iva" : "21%",
"margen" : "45",
"nombre" : "gfdgdf",
"preciocompra" : "4345",
"preciocompraiva" : "543",
"precioventa" : "543",
"precioventaiva" : "45",
"ref" : "43g34g"
},
"-LHYwvK6xAQeXHQVrmtt" : {
"descripcion" : "fdsf",
"fabricante" : "fdsf",
"iva" : "21%",
"margen" : "34",
"nombre" : "dfsfsd",
"preciocompra" : "sdfsd",
"preciocompraiva" : "dfsd",
"precioventa" : "43",
"precioventaiva" : "34",
"ref" : "432"
}
},
"clientes" : {
"-LHjGlhQD4iP9DOsGgvx" : {
"ciudad" : "rtbrtbrt",
"comentarios" : "gfdgfd",
"correo" : "brt@hotmail.com",
"cp" : "43243",
"direccion" : "tbrb",
"dni" : "rtbrtb",
"id" : 2,
"nombre" : "5brtbtrb"
},
"-LHjHImLC3UBW3M2Rf3_" : {
"ciudad" : "fmdkjsf",
"comentarios" : ".comsfdasa",
"correo" : "dkfmsldfm@jnfdjsn",
"cp" : "32434",
"direccion" : "fkdmfkjsd",
"dni" : "mklrmg",
"id" : 2,
"nombre" : "gkjsdnfgd"
}
}
}
i have been reading the documentation, and i have read about indexOn.
Currently i have this rules.
{
"rules": {
".read": true,
".write": true,
"clientes": {
".indexOn": ["nombre"]
}
}
}
I'm not sure if i'm doing it well.. but when i send de URL, /clientes.json?orderBy="nombre"&startAt=x
it is retrieving all the "clientes" that i have in the DataBase...
How i supposed to do it for receive all the "clientes" that start at "x"... i'm trying to develop a search input in my website...