【发布时间】:2018-03-07 02:02:50
【问题描述】:
这应该很容易,并且有很多类似的问题,但对我没有用。
这是我的代码,应该打印快照,但没有。
override func viewDidLoad() {
super.viewDidLoad()
let Ref = Database.database().reference(withPath: "Exhibitors-List/join").queryOrdered(byChild: "joinID").queryEqual(toValue:"1-22")
ref.observe(.value, with: {
snapshot in
var newItems: [Exhibitors] = []
for item in snapshot.children{
print(snapshot.value as Any)
let joinItem = Exhibitors(snapshot: item as! DataSnapshot)
newItems.append(joinItem)
}
self.items = newItems
self.tableView.reloadData()
})
}
在 idComp 或 boltLocation 中搜索一个孩子但在 joinID 中没有搜索时,获取快照没有问题,这是我的代码还是我的 Firebase 结构关闭?
【问题讨论】:
标签: swift firebase firebase-realtime-database