fql to get location posts by me or my friends with me tagged
-
26-06-2021 - |
Question
Here is what i'm looking for:
select author_uid, tagged_uids, page_id from location_post where author_uid = me() or ( author_uid in (select uid2 from friend where uid1=me()) and me() in tagged_uids)
When i split the queries they return the expected results.
i.e, both
- select author_uid, tagged_uids, page_id from location_post where author_uid = me()
- select author_uid, tagged_uids, page_id from location_post where author_uid in (select uid2 from friend where uid1=me()) and me() in tagged_uids
work as expected. What I need is a union of the 2. I'm tempted to say this is either a bug (or a limitation) in the API
Note:
- The OR clause itself works if the hard code one of my friend's id and my id. i.e author_uid=<my-id> or (author_uid=<frnd-id> and <my-id> in tagged_uids)
La solution
The problem was me() in the query. I had the user's ID around and replace me() with the actual ID did the the job
SELECT id, author_uid, page_id, tagged_uids, timestamp, coords FROM location_post WHERE (<id> IN tagged_uids or author_uid = <id>)
Autres conseils
What you are attempting to do will not work. You could try and run a multi-query and get back the results at once and compare them on your end.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow