0

如何查询用户评论的点赞数

4

1 回答 1

0

它必须基于一个对象,例如提要帖子、事件等。一旦您知道要获得评论的对象类型,您可以执行以下操作:

fql?q=select user_likes from comment where fromid=me() and object_id in (....)

如果没有 where() 中连接可索引列(例如 object_id)的子查询,则无法进行查询。这就是 Facebook 强制您加入他们的索引表、缩小结果范围(并阻止您执行“select *”之类的全扫描查询)的方式。

问题是,你必须选择一种对象来观察。例如,如果您想对用户发表的帖子发表评论:

fql?q=select user_likes from comment where post_id in (select post_id from stream where filter_key in (select filter_key from stream_filter where uid = me()))

您可以在可索引列(由 * 标记)上使用各种条件。测试它:

图 api 浏览器

facebook fql 评论表文档

于 2012-07-14T03:40:38.333 回答