You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hopefully this is welcome! I am really impressed with what you are doing here, I started on a little prototype for a filtering system myself, but am nowhere as far along as this.
I want to suggest a feature and a data structure for adding some really cool functionality to filters.
Problem
The current approach for filters uses conjunctions by default, but it is often useful to combine conjunctions and disjunctions together.
Solution
Add support for conjunctions (and), and disjunctions (or).
This can be supported by recursively nesting query filters via "value":
With this you can combine and nest conjunctions, and disjunctions as needed. It also works well for building a UI with nested objects.
Negations
I also wanted to suggest supporting negations directly for any given filter operator, e.g
%{"filter"=>"not equal",}
becomes
%{"filter"=>"equal","negate"=>true,}
Negations then become a really simple toggle for any given filter. In your code you then can define a single operation direction, and the inverse is just a negation.
P.S.
You can see an example of how this might work in this repo. I'm a novice at elixir, but I think this is illustrative of the idea.
The text was updated successfully, but these errors were encountered:
Hopefully this is welcome! I am really impressed with what you are doing here, I started on a little prototype for a filtering system myself, but am nowhere as far along as this.
I want to suggest a feature and a data structure for adding some really cool functionality to filters.
Problem
The current approach for filters uses conjunctions by default, but it is often useful to combine conjunctions and disjunctions together.
Solution
Add support for conjunctions (and), and disjunctions (or).
This can be supported by recursively nesting query filters via
"value"
:Example conjunction with a disjunction:
With this you can combine and nest conjunctions, and disjunctions as needed. It also works well for building a UI with nested objects.
Negations
I also wanted to suggest supporting negations directly for any given filter operator, e.g
becomes
Negations then become a really simple toggle for any given filter. In your code you then can define a single operation direction, and the inverse is just a negation.
P.S.
You can see an example of how this might work in this repo. I'm a novice at elixir, but I think this is illustrative of the idea.
The text was updated successfully, but these errors were encountered: