1

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: enter image description here

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Egle Matutyte
  • 225
  • 1
  • 8
  • 18
  • You're trying to query a dynamic path, which isn't possible. See my answer here for why and a possible solution: http://stackoverflow.com/questions/40656589/firebase-query-if-child-of-child-contains-a-value – Frank van Puffelen May 24 '17 at 14:21
  • Ok, I get it, but how I should solve it? could you help me? – Egle Matutyte May 24 '17 at 14:41

0 Answers0