1

We are developing hybrid mobile app using Angular2 and ionic2 and Firebase. We post data into firebase .We data like this

PinCode       blood group   Name           Age
--------      -----        ------         ------
534401         B+           Pavan          24
400084         A+           Alapati        35 
534333         B+           Sai            22

if user select Pincode:534401 and blood group:B+. We need show particular record data only.We tried like this

     this.showData = this.afd.list('/blooddetails/').$ref.orderByChild("pincode").equalTo(formData.pincode).ref.orderByChild("groupname").equalTo(formData.groupname);
        this.showData.on('child_added', function(data) {
        console.log(JSON.stringify(data));  
});

but we are getting OR case.We got two record form above table.first and last record.We need AND case.We tried Query also

this.showData = this.afd.list('/blooddetails/', {
  query: {
    pincode: formData.pincode,
    groupname: formData.groupname,
  }
});

But no lucky .Guide to us what we miss.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Pavan Alapati
  • 635
  • 2
  • 8
  • 21

0 Answers0