I am trying to get data from the following collection "Buses" if say Bus_Driver=="xyz".
My Firebase test looks like this:
I am getting database reference with this code:
busInfoReference= FirebaseDatabase.getInstance().getReference("Buses");
The following loop I've applied does not work correctly:
for(DataSnapshot ds : dataSnapshot.getChildren()){
busInfo = ds.getValue(BusInforamtion.class);
if(ds.exists()) {
if(busInfo.getBus_Driver().equalsIgnoreCase(driverName))
{
saveData()
break;
//}
}
}
How can I apply loop to get the required data? Thanks in advance.
