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.

Not on entire condition similar to all and any

See original GitHub issue

Not operator on entire condition. An operator similar to how all or any works but unary and returns true when the condition is evaluated to false. Example below: not: { any:[{ fact: 'employee', operator: 'equal', path: '.company', value: 'Microsoft', }, { fact: 'employee', operator: 'equal', path: '.company', value: 'Amazon', } ] }

Agreed that there are other ways to write the rule to support this, but that limits re-use of conditions and reduces using them without writing code for it, Ways are as follows:

  1. apply demorgan’s law to get to negate the whole condition.
  2. add them as dynamic facts and reuse them accordingly.

In my use case, i have a large number of conditions, which are dynamically added to other sets of rules using const objects. The lack of the not cripples this use case. If there is another way of achieving this without adding dynamic facts through code, please let me know.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
sbinlondoncommented, Jun 17, 2019

Since you seem to be waiting for many people to ask for this feature before deciding to write it, I just want to add that I came here looking for the exact same functionality, so it is something that would be very helpful 👍

0reactions
sam-wcommented, Jun 25, 2019

(I understand your reasoning for not having it at this point, btw. And thanks for an excellent and very useful lib!)

Read more comments on GitHub >

github_iconTop Results From Across the Web

The difference between Alzheimer's disease and other ...
Alzheimer's disease and dementia do not mean the same thing. ... while dementia is a general term for a group of similar diseases,...
Read more >
What Is Alzheimer's Disease? | National Institute on Aging
Learn about Alzheimer's, a brain disease that causes memory loss and other cognitive impairment. It's the most common cause of dementia in older...
Read more >
Dementia-like symptoms: What else could it be? - SCIE
Dementia-like symptoms can be caused by other conditions, many of which are treatable. Depression, nutritional deficiencies, side-effects from medications ...
Read more >
Pick's Disease: What It Is, Causes, Symptoms & Diagnosis
Pick's disease is a specific type of frontotemporal dementia, a degenerative brain disease that usually affects people under 65.
Read more >
What is Dementia? Symptoms, Causes & Treatment | alz.org
Dementia is not a single disease; it's an overall term — like heart disease — that ... including Alzheimer's disease, there is no...
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