我正在尝试获取用户新闻流,并从新闻流帖子的演员ID中获取个人资料的名称。
这是我使用的查询
NSString *fqlString = @"{"
@"'query0':'SELECT post_id, actor_id, message, created_time FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND is_hidden = 0 ORDER BY created_time DESC LIMIT 5',"
@"'query1':'SELECT id, name, pic_square FROM profile WHERE id IN (SELECT uid2 FROM #query0)',"
@"}";
这会返回OAuth异常,其中显示:"(#601) Parser error: unexpected '{' at position 0."
实际上它没有意义,因为query0和query1都作为单个查询工作。
任何人都可以帮我解决这个问题。
答案 0 :(得分:2)
你有:
type='newsfeed'
必须是type="newsfeed"
,因为您的查询已在撇号'
之后开始。uid2
中找到#query0
,因为uid2
表中不存在字段stream
。您最有可能需要actor_id
。以下是您更正的FQL查询:
{
'query0':'SELECT post_id, actor_id, message, created_time FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type="newsfeed") AND is_hidden = 0 ORDER BY created_time DESC LIMIT 5',
'query1':'SELECT id, name, pic_square FROM profile WHERE id IN (SELECT actor_id FROM #query0)'
}