I have a string that is equal to a list of other strings.
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 can result in a number of strings. Is it possible to queryEqual = multiple strings?
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)
})
}
I just want to be able to print out all the post that the postingID prints out. If the postingID prints outs more than one posts, I want to print all those posts out in my table view.