I have my DB in firebase but I want to do a where (I know there is no WHERE in a DB NoSQL but there will be some search function), like a login that is if I enter the user and the password brings me the corresponding data of a registration.
This is my BD in firebase:
An Example:
When I send the
telefono
totb01_usuario
bring me the corresponding data if the parameters match:Currently I'm doing it only with the ID that is similar to the telephone field, but I need to do it with the two fields that are inside each record, I hope you understand me
verifica_usuario(telefono: string) {
email = email;
telefono = telefono;
let promesa = new Promise((resolve, reject) => {
//this.items = afDB.list('/cuisines');
this.af.list('/tb01_usuario/' + telefono)
.subscribe(data => {
if (data.length === 0) {
//clave no es correcta
resolve(false);
} else {
//clave correcta
this.telefono = telefono;
this.guardar_storage();
resolve(true);
}
});
})
.catch(error => console.log("ERROR en promesa Service: " + JSON.stringify(error)));
return promesa;
}