I want to fetch data from multiple subnodes? I am able to fetch from the first subnode, but unable to get the next subnode level. I need only the account section from the firebase
I used this function to fetch the first subnode.
func compareAccount() {
REF_DRIVERS.observeSingleEvent(of: .value) { (snapshot) in
print(snapshot)
}
}
Snap (drivers) {
9AyIYcizavM03ArvmQH1e3xQ7rD3 = {
account = Default;
driverIsOnTrip = 0;
isPickupModeEnabled = 0;
provider = Firebase;
userIsDriver = 1;
};
FCuTwkhtrbdBTx7akQI4NL49K5p1 = {
account = Default;
coordinate = {
0 = "37.33233141";
1 = "-122.0312186";
};
driverIsOnTrip = 0;
isPickupModeEnabled = 0;
provider = Firebase;
userIsDriver = 1;
};
ML2Sxz6l78ZIZ0mO327nGmh0YkP2 = {
account = Default;
driverIsOnTrip = 0;
isPickupModeEnabled = 0;
provider = Firebase;
userIsDriver = 1;
};
}
func compareAccount() {
REF_DRIVERS.child("account").observeSingleEvent(of: .value) { (snapshot) in
print(snapshot)
}
}
When I try to print out only the account. It prints this result
Snap (account)
