我有一个等于其他字符串列表的字符串。
var postingID: String?
func loadDetails(){
Database.database().reference().child("main").child("users").child(screenName!).child("bookmarks").observeSingleEvent(of: .value, with: { (snapshot:DataSnapshot) in
if let postsDictionary = snapshot .value as? [String: AnyObject] {
for testingkey in postsDictionary.keys {
self.postingID = testingkey
}
}})
}
PostingID可以导致许多字符串。可以查询等于=多个字符串吗?
func loadData(){
Database.database().reference().child("main").child("posts").queryOrdered(byChild: "id").queryEqual(toValue: PostingID).observeSingleEvent(of: .value, with: { (snapshot) in
for child in snapshot.children {
let snap = child as! DataSnapshot
let dict = snap.value as! [String: Any]
self.posts.insert(dict, at: 0)
self.Bookmark.reloadData()
}
print(snapshot)
})
}
我只希望能够打印出postingID打印出的所有帖子。如果postingID打印出多个帖子,则我想在表格视图中打印所有这些帖子。