I got instagram like app. I got firebase as backend which has :
post node - contains all the posts from different users [post_id post_user post_name post_content]
Problem: I want to get the posts only from the users which I have followed.
My Steps:
I got list of following users_id in array
followersIds
I want to know if I can make query like
getFollowersList { (followersIds) in print(followersIds) self.postRef.queryOrdered(byChild: "user").queryEqual(toValue: followersIds).queryLimited(toLast: limit).observeSingleEvent(of: .value, with: { (snapshot) in if snapshot.value is NSNull { completion(nil); return} else { let dict = snapshot.value as! [String:Any] self.mapDictionaryToArrayOfPost(dict: dict, completion: { (posts) in completion(posts) }) } }) { (error) in debugPrint(error.localizedDescription) } }
ISSUE: Firebase can't accept array as parameter in queryEqual()
I can do this filter by filtering in the app but i want to query firebase and get the result . Beacause filtering in the app is not a good thing.
Any suggestion.