There are two ways of fetching data from server I used:
1)
firebaseService.databaseReference
.child("followers/\(id)")
.queryOrdered(byChild: "name")
.observeSingleEvent(of: .value)
2)
firebaseService.databaseReference
.child("followers")
.child(id)
.queryOrdered(byChild: "name")
.observeSingleEvent(of: .value)
id
is a string of userID. Why with first time I get snapshot with key id
and value null
and in the second time I get snapshot with key id
and value array of snapshots
?
The second time is the value i need. So the first time don't work as expected.