Query is not working properly in firebase database?

208 Views Asked by At

I have database of "date" "part" "heat" "defect" these all are child of defect

I tried to filter with date. It's working for 19/4/2021 fine. But not working for any other date. For any other that are present in database it showing result of first two data.

Please refer to these screenshots:

Full database

For 19/4/2021 filter

For any other date

com.google.firebase.database.Query query = defect.orderByChild("date").equalTo(query);
ValueEventListener valuelistener2 = new ValueEventListener() {
 @Override
   public void onDataChange(DataSnapshot _dataSnapshot) {
   map_list = new  ArrayList<>();
try {
 GenericTypeIndicator <HashMap<String, Object>> _ind = new GenericTypeIndicator<HashMap< String, Object>>() {};
 for (DataSnapshot _data : _dataSnapshot.getChildren()) {
 HashMap <String, Object> _map= _data.getValue(_ind);
 map_list.add(_map);
}

I also have attached source code photo heresource Source 1

0

There are 0 best solutions below