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

Remove "only logical nots" limitation #28

Open
vmx opened this issue May 11, 2017 · 2 comments
Open

Remove "only logical nots" limitation #28

vmx opened this issue May 11, 2017 · 2 comments
Assignees

Comments

@vmx
Copy link
Member

vmx commented May 11, 2017

When you negate all your operators like:

find {webChannel: != null}

you get this error:

{"error": "Error: query cannot be made up of only logical not. Must have at least one match clause not negated."}

But as we now have find {} it makes sense to also support those queries.

@Damienkatz
Copy link
Member

The thing about this is it must look at every document to figure out the results. When using find {} it's obvious that's happening. The expensiveness of it would be surprising to users. I suggest we close this bug.

@vmx
Copy link
Member Author

vmx commented May 25, 2017

So the workarounds would be:

  • Doing a find {} query and filtering out things on the client side
  • Adding an additional field which is the same for every document and add this to the condition

I'll add those to the language reference. Once merged we can close this bug.

vmx added a commit to vmx/noise that referenced this issue May 25, 2017
You cannot have every clause be negated as it's a very resource intensive
operation. Query need at least one non-negated clauses. There are two
workarounds:

 - Do a `find {}` and filter out the results in your application
 - Add a field that will always match and use it in your condition. Example:

    find {alwaystrue: == true && foo: !~= "bar"}

Add this information to the language reference and the repl-tests.

Fixes pipedown#28.
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