Gor*_*per 4 firebase firebase-realtime-database swift4
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!)
})
Run Code Online (Sandbox Code Playgroud)
您需要添加一个查询:
ref.queryOrdered(byChild: "videoid").queryEqual(toValue: "12345").observeSingleEvent(of: .value, with: { snapshot in
Run Code Online (Sandbox Code Playgroud)
更多信息在这里:
| 归档时间: |
|
| 查看次数: |
2255 次 |
| 最近记录: |