Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter: Allow filtering on children collections. #10

Open
TrevorVonSeggern opened this issue Mar 20, 2018 · 3 comments
Open

Filter: Allow filtering on children collections. #10

TrevorVonSeggern opened this issue Mar 20, 2018 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@TrevorVonSeggern
Copy link
Owner

partner/id eq 1

  • Should be a valid query.
@TrevorVonSeggern TrevorVonSeggern added bug Something isn't working enhancement New feature or request labels Mar 20, 2018
@TrevorVonSeggern
Copy link
Owner Author

For the query: partner/favorite/id eq 1
Is there an implicit filter for: partner ne null and partner/favorite ne null?

What about collections?
Do collections get filtered with all, any, or does it filter the items within the collection?

@TrevorVonSeggern TrevorVonSeggern added this to the v1.0 milestone Mar 22, 2018
@TrevorVonSeggern TrevorVonSeggern added the question Further information is requested label Mar 24, 2018
@TrevorVonSeggern TrevorVonSeggern removed the bug Something isn't working label Apr 30, 2018
@TrevorVonSeggern
Copy link
Owner Author

According to Example 93 in the specification, filters that are applied to child collections only provide a filter on that collection, not the entire result set.
Example:
Categories:

[
{id: 1, labels: [ 'red', 'blue' ]},
{id: 2, labels: [ 'red', 'green' ]}
] 

=> to endpoint /api/Category
The query /api/Category?$expand=labels($filter="red"),
or the query /api/Category?$expand=labels & $filter="red"
would return the result:

[
{id: 1, labels: [ 'red' ]},
{id: 2, labels: [ 'red' ]}
] 

@TrevorVonSeggern TrevorVonSeggern removed the question Further information is requested label May 7, 2018
@TrevorVonSeggern TrevorVonSeggern moved this from To do to In progress in NOData v1 release May 17, 2018
@TrevorVonSeggern TrevorVonSeggern removed this from In progress in NOData v1 release May 18, 2018
@TrevorVonSeggern TrevorVonSeggern modified the milestones: v1.0, v2.0 May 18, 2018
@TrevorVonSeggern
Copy link
Owner Author

Unit test: [TestCase("children($filter=id eq 10)", 1, 2, 3, 4, 5, 6, 10)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant