Skip to content
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

oso-nodejs: make support for 'not' operator in custom data filtering conditions #1543

Open
trendchaser4u opened this issue Mar 20, 2022 · 2 comments

Comments

@trendchaser4u
Copy link

trendchaser4u commented Mar 20, 2022

Yes, I know we could use negative conditioning instead of not operator, but providing built-in support for not operator comes handy when we are dealing with conditions using big list of values.

Also, the list condition (example: using 'in' operator) trying to convert into simple conditions using 'or/and' operators, which is ok with small list but against the large list !! this is not an efficient way to do that. so, providing straight forward solution to this will help. like following

{
   lhs:{
     typename:'Article',
     fieldname:'id'
  },
  cmp:'in',
  rhs:{
    value:[] // for very large list 
  }
}

Classic example would be fetching all the repos(let's say 100+ repo under his id) of a user. if we'd support in operatory then the query conversion would be easy and efficient by using sql 'in' operator.

@cofinalsubnets
Copy link
Contributor

Hi @trendchaser4u , I think (2) is a great suggestion, since the whole point of data filtering is to produce efficient queries. Could you give an example of what you mean by (1)?

@trendchaser4u
Copy link
Author

trendchaser4u commented Mar 21, 2022

Sure,

I'm not a big fan of using not with in operator, but still we can't predict the use cases.
For argument sake I've a list of suppliers and want to fetch the list of products not from that supplier list,
like this..

let suppliers=[...]; //25 items

Select * from product p where p.supplier not in (...suppliers);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants