can you please let me know how to filter the item in a collection in graph Api?
Scenario
Iam storing the Filter Value in a collection, and again have to filter my Library Data's with the Collection Values to display the Metadata.
Related
Is there any recommendation on how URL for API returning aggregated values and response from API should be.
for example: publisher has multiple authors and we want to return total amount of sale from all the authors (or filter for authors to consider for getting sum).
Thanks
Using the graph api documentation I read that its possible to list all the groups within a tenant ( /groups endpoint) and its possible to use startswith or eq in displayname query. I was wondering if there is a way so search for groups with a specific text in the group displayname. Contains and endswith are not supported. If possible I want to prevent code that reads all groups and searches within the result.
Currently filter parameters for Graph API's does not support "contains". Check this document - https://learn.microsoft.com/en-us/graph/query-parameters
I have OData source, that implements $skip and $top parameters.
There are x number of entities that are returned. Say, I have only 250 entities. And then I try to do the paging like this:
https://example.com/EntitySet?$top=30&$skip=220
If my skip goes beyond the number of total entities, I eventually get timeout from service.
Is there a parameter or data, that would inform me that there are no more items? Is there something that can/should be implemented on OData side, that gets returned instead of timeout?
For OData 2.0 and OData 3.0 protocols:
You should use: $inlinecount=allpages
http://services.odata.org/OData/OData.svc/Products$inlinecount=allpages&$top=5&$format=json
Identifies the first 5 Product Entries and
includes a count of the total number of Product Entries.
For OData 4.0, you can read the nextLink annotation embeded in the response. (See example here)
4.5.5 Annotation odata.nextLink The odata.nextLink annotation indicates that a response is only a subset of the requested collection
of entities or collection of entity references. It contains a URL that
allows retrieving the next subset of the requested collection.
If you add &$count=true to your uri the service will include a total count in the response. The json response will include a "#odata.count" property. This property indicates the total number of entities.
That way you can check if you've received all entities.
I have been looking around everywhere online and can't seem to get a solid answer. If I have an event with multiple attributes stored in Core Data in an array and I can display all of these individual events in a tableView. Lets say one of the attributes is a date. Is there away to search for all of the events that contain a certain date and display only those in the tableView? I was thinking of using NSPredicate from what I am seeing online but I am not familiar with this. Maybe somehow find the index of the event that contains that date and only display that index? Any ideas?
Table views are designed to implement a one to one relationship with the underlying array of data. The usual approach is to use a fetchRequest to only get the data you want to display ( I personally like to have all my requests pre-defined in the data model so I can keep track of how data is accessed).
But, if your array of managed record must contain more elements than what you want to display, you should consider basing your tableView datasource responses on an intermediate array that only contains (or refers to) the objects you want to show.
For example:
let allEvents:[EventRecord] = GetAllEvents()
var filteredEvents:[EventRecord] = allEvents.filter({ $0.eventDate.isEqualToDate(dateToDisplay) })
and use filteredEvents as your underlying store for your datasource.
This will make it easy to dynamically change the filtering conditions and reload the tableview without having to go back to the database for each filter change.
Is there a way to query by multiple resourceId's using the .Net library?
For instance, usually I query for a single feed entry by resourceId like this:
DocumentsListQuery query = new DocumentsListQuery();
query.Uri = new Uri(string.Format("{0}/{1}", DocumentsListQuery.documentsBaseUri, doc.ResourceId));
DocumentsFeed feed = service.Query(query);
I'm wondering if there's some way to query for multiple documents by their resourceId's in a single query, instead of just fetching the whole list.
A single RESTful query can only return a single element or a feed, so there's no way to query by multiple resourceId's.
An alternative might be to specify a search query that restricts your results to the elements you want, but such search criteria only exist if your files have something in common that differentiates them from the other documents.
The documentation for search query in the Documents List API is available at https://developers.google.com/google-apps/documents-list/#searching_for_documents_and_files, but I'd also recommend you to take a look at the newer Drive API and at how it manages search:
https://developers.google.com/google-apps/documents-list/#searching_for_documents_and_files