简体   繁体   中英

Get profile picture creation date from user table in FQL

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.

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'
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM