FQL查询:如何选择来自同一国家的用户
如何编写 FQL 查询来选择来自同一国家/地区的用户?
由于 home_location 不可索引,因此我们不能使用 home_location 作为索引。
那么,该怎么做呢?
How do I write the FQL query to select users from the same country?
As hometown_location is not indexable, we cannot use hometown_location as the index.
So, how to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以(如果您查询的用户数量不是过多)只需获取所有用户的
hometown_location
属性,然后自行过滤即可。You could (if it wasn't an excessive number of users that you were querying) just get all of them with their
hometown_location
attribute and then filter it yourself.如果您已经注意到 FQL 不允许您使用该列进行比较,那么您将需要将您正在查看的每个用户信息加载到代码中的某个数组中。然后循环遍历该数组来比较 home_location。
If you've already noticed that FQL won't let you compare using that column, then you will need to load each of the user's info you are looking at comparing into some array in your code. Then loop thru that array comparing the hometown_location.