In the BreezeJS documentation http://www.breezejs.com/documentation/projection-queries they describe how to perform a projection on Related Property and it works fine on my developing environment.
var query = EntityQuery.from("Orders")
.where("Freight", FilterQueryOp.GreaterThan, 500)
.select("Customer.CompanyName")
.orderBy("Customer.CompanyName");
But if i publish the application when i run the query i get the error:
Only properties specified in $expand can be traversed in $select query options
This is an OData restriction when using the OData provider, ( it does not occur with the standard WebApi provider), but in any event you can get around it by adding
.expand("Customer")
to your query.
Related
I'm currently trying to implement a search function for a table in a database that uses Breeze Sharp and Breeze Asp Net Core. In their docs they just say to do this.
// Customers whose name contains the word, "market"
var query = new EntityQuery<Customer>()
.Where(cust => cust.CompanyName.Contains('market'));
But I have done essentially that and still get an error. The error is from the JsonQueryExpressionVisitor VisitMethodCall function when ExecuteQuery is creating the resourcePath. It says
"The method 'Contains' is not supported"
Is there any viable way to implemenet a search feature using Breeze?
Following query in MS Graph Explorer displays signed-in user's profile and its manager Diego Siciliani
https://graph.microsoft.com/v1.0/me?$expand=manager
But you may notice in the response it is returning tons of attributes of manager object, as well. Some of these attributes are objects (such as assignedPlans) themselves and have their own attributes, as well.
Question: How can we filter the above query so it returns user profile (that it is already doing) along with ONLY the following attirbute value the user's manager: "displayName": "Diego Siciliani"
Remark: Following query returns the error shown below: https://graph.microsoft.com/v1.0/me?$expand=manager($select=displayName)
Invalid $select properties
Please use the below query to get user and his manager details
https://graph.microsoft.com/v1.0/users/userid?$expand=manager($levels=max;$select=id,displayName)&$select=id,displayName&$count=true
ConsistencyLevel eventual
Update https://graph.microsoft.com/v1.0/me?$expand=manager($levels=max;$select=displayName)&$count=true
It is known issue from Microsoft that nested $select combined with $expand doesn't work (i.e. $expand=some_path($select=some_field) does not work with Microsoft Graph API).
See: https://learn.microsoft.com/en-us/graph/known-issues#query-parameter-limitations
$expand:
No support for nextLink
No support for more than 1 level of expand
No support with extra parameters ($filter, $select)
I wish they would implement it because right now we either have to pull a lot of extra data (e.g. for managers), or we have to make a lot of requests per user to retrieve just the field we want.
There's a solution that deal with batch requesting but it requires a json solution: https://learn.microsoft.com/en-us/graph/json-batching?view=graph-rest-1.0
I'm learning to get delta data from SAP Fiori sample gateway to Azure SQL by using Azure Data Factory and filter feature on OData service.
I'm using OData Service that exposed by Fiori sample, and one of the table sample is PurchaseOrders.
I tried like this:
$filter=ChangedAt ge datetime '2020-09-08T22:00:00'
But it is still return all the records.
I found sap:filterable is false at metadata
Is that filterable false is made me cannot filter this?
Is there any other way to do delta extraction on OData rather than using filter?
Thank You
As #Boghyon wrote above the "sap:filterable" is just an Annotation, which can help to build the UI. You have to check the DPC_EXT class's GET_ENTITY_SET method of the entity type that you try to filter. If filtering isn't implemented then (1.) in case of standard service you're more or less stuck (it cannot be filtered for a reason) (2.) in case of custom service you can implement filtering
I'm using getRecentFiles MS Graph API and I'd like to filter out only certain file types (by file extension). However, when I try $filter query parameter it is ignored. Documentation on the method doesn't mention anything like this.
Is this behavior expected or is it a bug?
I believe that is expected as no OData query parameters link is not present on the page (when OData query parameters are supported, then its listed in a paragraph).
I have not managed to make it work, neither for drive item properties (eg. id, creation date) nor for nested properties (remoteItem/name or remoteItem/createdBy/user).
We have a need to select records based on the value of a related child table's properties. I discovered today that this feature is supported in odata with a keyword called 'any'. Further it's supported in the default breeze server implemention (using entity framework). Using the same server that my breeze client does, I can enter an odata query in a browser using the 'any' keyword and select records on a related child's field value. For example:
.../Issue?$filter=oIssueImages/any(ii: ii/IssueImageRef eq 4)
And it works! But, there is no support for this in the breezejs client code.
FWIW: I found this breeze feature request: https://breezejs.uservoice.com/forums/173093-breeze-feature-suggestions/suggestions/3988038-adding-any-and-all-filter-operators
Anyone know when breeze will implement this feature?
Updated post: 11/25/13
As of Breeze 1.4.6, 'any' and 'all' operators are now supported.
So your client side Breeze query would look something like:
var query = EntityQuery.from("Issue")
.where("oIssueImages", "any", "IssueImageRef", "==", 4);
myEntityManager.executeQuery(query).then(...)
Also see: http://www.breezejs.com/documentation/query-examples
Older post
Please vote it up. This is a really good feature, but we really do try to accommodate those features that get the most votes.