-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Support for 'isnull' operator #21
Comments
I think you can accomplish isNull or isNotNull as follows. |
Assuming title is of type String, How do you differentiate between: |
Yes. There is no way to distinguish between null and 'null'. Ideally, we need a unary operator which is Option1. |
I also prefer Option 1, but I'm not sure it agrees with FIQL grammar:
Should we relax FIQL compliance and go with the more natural syntax? |
I ended up implementing this in our project using the ambiguous 'null' string after bumping into the unary operator issue, but I'm really liking the sound of option 2. It doesn't require messing with the FIQL syntax compliance and can already be implemented by the end-user using a custom operator, plus is inherently backward-compatible since it's just an additional operator(s). |
Agree with @chibisoft |
I'm fine with option 2. Do we want to make it a default comparison operator - or should this be considered custom? I would imagine default (not custom) would be more useful to others. Also, I played with option 1 (which has the benefit of shortening the URL). I was able to make relatively minor changes to the grammar if I:
Is option 1 worth exploring through a PR, or should we just proceed with option 2? If option 2, default or custom? Thanks. |
Hi, |
Just to cross-link: tricolor2 added a pull request for this feature in December 2018. See #37 |
For those asking in 2021, you can check my lightweight library which supports is null, is empty, and/or, bools, enums, dates, searching over relations (joins), and much more here https://github.com/turkraft/spring-filter |
Overview
None of the existing operators provide support for testing whether a field is null or conversely is not null.
Technically, such an operator would not require arguments, but the grammar currently requires them:
Here are three suggestions for adding this support:
Option 1
Add new operators:
Change the grammar to allow 0 argument comparisons.
Option 2
Add new operator:
The new operator would take any of the following restricted arguments:
Option 3
Allow '()' as an argument for operator '==' and '!='. The empty list implicitly means null in these contexts.
The text was updated successfully, but these errors were encountered: