Question

I use FQL for getting information about users post. For example:

  Select likes from stream where post_id='100000481752xxx_828718160487568'

return me next:

{
"data": [
        {
        "likes": {
         "href": "https://www.facebook.com/browse/likes/?id=828718160487568", 
        "count": 2, 
       "sample": [
                 100000640266xxx, 
                 100000481752xxx
                 ], 
      "friends": [
                 ], 
   "user_likes": false, 
     "can_like": false
                 }
        }
        ]
}

How can I select only fields "count" and "sample" from "likes" ?

Was it helpful?

Solution

Use field.subfield so that:

SELECT likes.count, likes.sample 
  FROM stream 
 WHERE post_id='100000481752xxx_828718160487568'

results in:

{
  "data": [
    {
      "likes": { 
        "count": 2,
        "sample": [
                 100000640266xxx, 
                 100000481752xxx
        ]
      }
    }
  ]
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top