Filter OR operator and complex predicates
See original GitHub issueCurrently, filter values are split by comma into separate FiterQuery
s. This makes things like this possible:
?filter[attr]=abc,like:def
But, this doesn’t make much sense and the proper query should be:
?filter[attr]=abc&filter[attr]=like:def
It also prevents custom queries from being picked up using IQueryAccessor.GetRequired<>()
This issue has been re-purposed for the discussion of complex filter predicates (anything other than simple serial AND)
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Java 8 Predicate Chain
In this article, we explored different ways to chain Predicates in Java 8, by using filter(), building complex Predicates, and combining ...
Read more >Java Predicate with Examples - Filtering Streams ...
Predicates are used to filter Streams. ... We can create a complex Predicate by mixing two or more predicates.
Read more >Java 8 Streams: multiple filters vs. complex condition
Sometimes you want to filter a Stream with more than one condition: myList.stream().filter(x -> x.size() > 10).filter(x -> x.isCool ...
Read more >Merging Predicates? How to have some neat looking filter ...
Whenever I used to write filter in Java 8 streams, I knew how to combine them using AND condition (you put one filter...
Read more >How to fetch and filter data in SwiftData with Predicates
Predicates are logical conditions that evaluate a Boolean value (true or false). They are commonly used for filtering and sorting data based on ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@wisepotato @jaredcnance it’s pretty ironic that the trigger for the OR filter reappeared right now. Although I did implement this feature in March, it was never included in our product.
For the upcoming sprint (two weeks) I got the task to dust off/finalize the implementation and get it into production.
I’ll happily share my solution.
From the jsonapi.org spec:
GET /comments?filter[post]=1,2 HTTP/1.1
http://jsonapi.org/recommendations/#filtering