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

Handle with other operators besides = #7

Open
lucasbesen opened this issue Sep 25, 2019 · 2 comments
Open

Handle with other operators besides = #7

lucasbesen opened this issue Sep 25, 2019 · 2 comments
Labels
discussion enhancement New feature or request

Comments

@lucasbesen
Copy link
Contributor

lucasbesen commented Sep 25, 2019

We can use raw SQL but would be nice something less handful

SELECT * FROM users WHERE id != "bla"

Something like that:

Foo.find({ name: { type: NOT, value: "James" } })

@fakenickels idea:
Foo.find({ name: Not("James") })
Not(Between (2))

A class from Operator, so we can switch on top
So we can have Not, Equal, Between
And in the query builder we detect and add the correspondent query

More ideas?

@lucasbesen lucasbesen added enhancement New feature or request discussion labels Sep 25, 2019
@fakenickels
Copy link
Contributor

Voting for the Operator class based one, easier to code in JS and more portable to Reason

@fakenickels
Copy link
Contributor

  Foo.find({
       name: {
         type: 'NOT',
         value: { type: 'BETWEEN', start: 2, end: 4 }
       },
       foo: true,
   })
Foo.find({
  name: Not(Between(2, 4)),
  foo: true,
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants