最佳答案
您好,我在开发一个使用 firebase 作为后端服务的聊天应用程序时遇到过类似的情况。
你可以这样使用查询,我通过类似的查询做到了
FireBase.Reference.threads
.queryOrdered(byChild: "ownerId")
.queryEqual(toValue: "YourUserId")
.observe(.value) { (snapshot) in
if let messages = snapshot.value as? NSDictionary {
// you will get all those threads where ownedId is what you need to fetch for
}
}
希望这对您有所帮助,如果需要任何更正,请告诉我。
关于swift - 使用 Swift 根据条件从 Firebase 数据库中获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45552127/