首先,current_location 是一个结构,所以current_location IN ('Chennai','Tamilnadu') 不起作用。
您需要指定结构中的任何字段,即:
current_location.city
current_location.state
第二,只会找到你授权过你应用的朋友。例如,我的一位来自伦敦的朋友正在使用 Graph API Explorer。这是自推出 v2.0 Facebook API 以来的新功能。 Read more here.
所以,这个查询:
SELECT uid, current_location
FROM user
WHERE current_location.city IN ('London')
AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me() )
给予:
{
"data": [
{
"uid": "73221xxx",
"current_location": {
"city": "London",
"state": "England",
"country": "United Kingdom",
"zip": "",
"latitude": 51.5072,
"longitude": -0.1275,
"id": "106078429431815",
"name": "London, United Kingdom"
}
}
]
}