Reputation: 597
let ref = Database.database().reference(withPath: "user")
ref.observeSingleEvent(of: .value, with: { snapshot in
if !snapshot.exists() { return }
print(snapshot) // Its print all values including Snap (User)
print(snapshot.value!)
let username = snapshot.childSnapshot(forPath: "full_name").value
print(username!)
})
Upvotes: 5
Views: 2689
Reputation: 80934
You need to add a query:
ref.queryOrdered(byChild: "videoid").queryEqual(toValue: "12345").observeSingleEvent(of: .value, with: { snapshot in
more info here:
Upvotes: 5