Approved
Last Updated: 21 Mar 2019 07:24 by ADMIN
Fabio
Created on: 15 Mar 2019 15:24
Type: Feature Request
2
Support lambdas in odata filter string

I would like to request the data-query package support filtering on OData collections using lamdba functions. Given a Collection with the existing operators, the filter string outputted by `toODataString` should be OData v4 compliant.

 

Example: Project is a collection. A user filters to see all General projects which outputs { field: 'Project', operator: 'eq', value: 'General' }.

 

Recommendation: Supply another key that dictates the lamdba operator and property field to use.

{ field: 'Project', operator: 'eq', value: 'General', lambda: 'any', collectionField: 'Name' } -> $filter=Project/any(x:x/Name eq 'General')

 

The above can work with inner functions like contains.

{ { field: 'Project', operator: 'contains', value: 'gen', ignoreCase: true, lambda: 'any', collectionField: 'Name' } -> $filter=Project/any(x:contains(tolower(x/Name),'gen'))

2 comments
ADMIN
Stefan
Posted on: 21 Mar 2019 07:24
Hello, Fabio,

Thank you for submitting the request.

Based on its popularity the developers' team will plan it for a future release.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Fabio
Posted on: 20 Mar 2019 15:01

To add to this, we also have Singles that aren't collections. The above example would extend to:

{ field: 'Location', operator: 'eq', value: 'Home', innerField: 'Name' } -> $filter=Location/Name eq 'Home'