question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter OR operator and complex predicates

See original GitHub issue

Currently, filter values are split by comma into separate FiterQuerys. 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:closed
  • Created 6 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Oct 26, 2018

@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.

1reaction
rtabladacommented, Dec 15, 2017

From the jsonapi.org spec:

Multiple filter values can be combined in a comma-separated list. For example:

GET /comments?filter[post]=1,2 HTTP/1.1

http://jsonapi.org/recommendations/#filtering

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found