【发布时间】:2016-06-05 07:43:11
【问题描述】:
我是 firebase 新手,我的 firebase 项目有这样的结构
我想获取所有对象,“Interested”值等于“men”
我写了这样的代码,让所有对象按兴趣值排序:
let thisUserRef = URL_BASE.childByAppendingPath("profile")
thisUserRef.queryOrderedByChild("Interest")
.observeEventType(.Value, withBlock: { snapshot in
if let UserInterest = snapshot.value!["Interest"] as? String {
print (snapshot.key)
}
}
但我收到零。
【问题讨论】: