graph api - is it possible exclude id field? - facebook

Is it possible exclude id field with "fields" query parameter, for example:
https://graph.facebook.com/zuck?fields=name
I'm not asking for FQL, i'm just curious the possibility to exclude id at this point.

Related

Azure Search querying json metadata

I have indexed documents with a "MetadataFields" key whose values are json.
"MetadataFields": "{"continent":"north america","country":"united states","region":"x34","tagnumber":"abc-123"}
I'm able to search for a specific match in Search Explorer using
MetadataFields/tagnumber:abc-123
But I cannot figure out how to find documents where this attribute is null or missing. Is this possible? What is the proper syntax?
In Azure Cognitive Search, you can use filtering to find null items.
In Search Explorer, the syntax would look like this:
$filter=MetadataFields/tagnumber eq null
To do this, you would need to have the field tagnumber marked as filterable in your index definition.

Find documents with a certain field value only when another field value is a given string

I'm using this php package to make queries - https://github.com/jenssegers/laravel-mongodb
The situation is, there are two fields, user_id and post_status among others. I want to retrieve all the documents in that collection, but when post_status field value is draft, that should be retrieved only when user_id is a given string. The idea is, only logged in user finds their drafted posts among other posts.
I'm having hard time finding any solution for this problem. The app is still not in production. If I should store data is some different manner, that is an option as well.
Find documents with a certain field value only when another field value is a given string
The question your are framing is simply convert into a and query, how let's see it
when another field value is a given string
This means that you have some result sets and you need to filter out when user_id match with some string. i.e some result sets and user_id = <id>
Now consider the first part of the sentence Find documents with a certain field value
This means you are filtering the records with some values i.e "status" = "draft" and whatever result will come and want again to filter on the basis of user_id = <id>
So finally you will end-up with below query:
db.collectionName.find({"status":"draft", "user_id": "5c618615903aaa496d129d90"})
Hope this explanation will help you out or you can rephrase your question I will try to modify by ans.

facebook open graph api - filter node collection by field

At a high level, what I'm looking for is all of the posts a specific user has made in a group.
I can access the group feed, which contains all posts made in the group, like this:
GET 2.10/<group-id>/feed
where 2.10 is the api version I am using
I can see the author of all the posts in the feed by reading the "from" field:
GET 2.10/<group-id>/feed?fields=from
the "from" field displays a user, which is represented as a JSON object with two properties:
"from": {
"name": <user_name>,
"id": <user_id>
}
some collections have "read modifiers", for example on a feed that belongs to a person's profile, you can filter for only posts that have locations attached to them:
GET 2.10/me/feed?with=location
It seems a "read modifier" on the group feed would be what is needed, however none are documented: https://developers.facebook.com/docs/graph-api/reference/v2.10/group/feed
Is there any way to filter the feed so that it returns only posts by a specific author?
rephrased more generally:
is it possible to filter a collection of nodes by a node attribute?
is there another possible way to query for posts made by a specific person in a specific group?

How can i search events by description field using Graph API?

I'm trying to list all upcoming events for a given artist. Unfortunately, the query that i use:/search?type=event&fields=name,description,place&q=artist-name does not list all available events. It only lists the events for which the keyword "artist-name" match the field "name". To display all available events, the query must look into the "description" field in addition to the "name". How can i make such a query ?

Github API field descriptions

I'm toying with the Github search API (v3) and can't seem to find a description of the fields that are returned. Most of them are obvious, but there are a few like score that aren't. Does anyone know what score means, and does a field reference exist?
The score attribute is the search score of that document for a particular query, and is used for Best Match sorting. In other words, it's used for ranking search results, but it isn't shown in search results on github.com.