Reputation: 2281
How can I get my friends profile pictures creation date using FQL multi-query
?
I wrote below query:
SELECT src_small, src_big, src FROM photo WHERE src IN
(SELECT pic_square, pic_small, pic_big, pic FROM user WHERE uid IN
(SELECT uid2 FROM friend WHERE uid1 = me()) )
but it says:
{
"error": {
"message": "Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http://developers.facebook.com/docs/reference/fql ",
"type": "NoIndexFunctionException",
"code": 604
}
}
Thanks in advance.
Upvotes: 0
Views: 819
Reputation: 96306
from comment by Arjuna Del Toso:
You can use a column in the WHERE clause only if it's marked as "indexable"
Not, that is not totally correct.
You need at least one indexable column in your where clause – once you have that, you can use other, non-indexed columns as well to further restrict the result.
Since the user’s current profile picture is always the album cover photo of their Profile Pictures album, we can use that to get the object_id
of the profile picture of our friends, and than use that to select the info we want from the photo
table:
SELECT owner, src_small, created FROM photo WHERE object_id IN (
SELECT cover_object_id FROM album WHERE owner IN (
SELECT uid1 FROM friend WHERE uid2 = me()
) AND name = 'Profile Pictures'
)
Upvotes: 2