Problem with jsonlogic type and operator "between ,"not in" and "not between"
See original GitHub issueI use custom rangeDate component and I need to export field’s object as jsonlogic. I have two dates and operator “between” and it exported like {"<=":["2022-09-22",{"var":"date"},"2022-09-28"]}
. When I import this rule to query builder with parseJsonLogic it gives me operator: “<=” and only first value, second value lost. What can I do with it? Moreover if I used “not between” in rule, it gave me a group, which has notToggle:“true” and operator:“between”. I need to disable notToggle and take back operator:“not between”. The same problem with “not in”. How can I get it?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
diegoholiveira/jsonlogic - Error if var is missing from data
Hello, I seem to hit a case where the library is returning an error when a property, that is in the "logic" but...
Read more >Supported Operations
Build complex rules, serialize them as JSON, share them between front-end and back-end. ... Tests not-equal, with type coercion. Logic. {"!=" : [1,...
Read more >Representing logic as data in JSON
If logical LogicalOperator is left out between conditions, it will automatically joins them with AND; Inner arrays are parsed as nested groups (EG...
Read more >jsonlogic
This parser accepts JsonLogic rules and executes them in Go. ... 3 values to test that one value is between but not equal...
Read more >How to store and process rules and logic with JsonLogic
“Build complex rules, serialize them as JSON, share them between ... A foreword for anyone hoping to use JsonLogic in production environment: It's...
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 Free
Top 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
okey, thank you very much for your prompt replies and your efforts)
@Egor3842 - I believe PR #367 fixes the issues with “between” and “in”. It also converts the substring operators (“contains” / “beginsWith” / “endsWith”) to their negating counterparts (“doesNotContain” / “doesNotBeginWith” / “doesNotEndWith”) if a single rule is wrapped in
{ '!': ... }
.You can try out the query->JsonLogic and JsonLogic->query transformations based on the code from #367 with this codesandbox.