I created database with firebase, I got events block and I try to retrieve information which events my user is joined, but I didn't get any answer, could you help me with that?
function to fetch witch events user joined:
func startObersvingDBJoined() {
FIRDatabase.database().reference().child("events").child("peopleWhoJoin").queryOrdered(byChild:"userID").queryEqual(toValue: FIRAuth.auth()!.currentUser!.uid).observe(.value, with: { (snapshot: FIRDataSnapshot) in
var newUpdates = [Event]()
for update in snapshot.children {
let updateObject = Event(snapshot: update as! FIRDataSnapshot)
newUpdates.append(updateObject)
}
self.updates2 = newUpdates
self.sectionData[1] = self.updates2
self.tableView.reloadData()
}) { (err) in
print(err.localizedDescription)
}
}
I am tring to compare uid in DB peopleWhoJoined and current user uid, but I didn't get anything.
DB: