1

Hi i have written a query by which i can fetch posts,actor_id,comments and other columns required from stream table. But i want to fetch user's name also along with actor id and other columns in a single query. My queries is :

select message,created_time,actor_id,attachment,comments,created_time,impressions,likes,message,message_tags,place,share_count from stream where source_id in (any_page_id)

I want to add user's name also from user table along with this list of columns i am fetching from stream table in a single query so that i can handle it in a single json file. .

Also in comments we will get several user's id with comments as from_id. Can we get username for this from_id also. Is this possible, i know we cannot use join in FQL. Or i am missing something or in a wrong approach. Please help me out. Thanks in advance.

Updated

Now i am able to get actor_id and other fields of the post together along with user's name at the end in the same json using multi-query. Something similar to :

fql?q={"query1":"select+message,created_time,actor_id,attachment,comments,created_time,impressions,likes,message,message_tags,place,share_count+from+stream+where+source_id+in(any_page_id)","query2":"select uid,name from user where uid in (*#query1* "}

But now i am not able to get the user's name and user's id who are there in the comments of the post in the same json.

4
  • You have th3 complete comments object - which is an array of the users who have commented; what else you want? Sep 13, 2013 at 12:49
  • hi yeah i got the comments which is in a array, this array now contains user_ids, but i am not getting user_name. So is there any way around so that i can get user_names of those who have comented in the same json file. Sep 16, 2013 at 7:47
  • I dont think you could get that in the same JSON, you have to make a seperate call for that Sep 16, 2013 at 8:07
  • Yeah i also think the same. Thanks for replying. :) Sep 16, 2013 at 9:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.