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

fix(query-builder): added more tests for 'or' and 'and' combined #798

Closed
wants to merge 1 commit into from
Closed

fix(query-builder): added more tests for 'or' and 'and' combined #798

wants to merge 1 commit into from

Conversation

charmpitz
Copy link
Contributor

@charmpitz charmpitz commented Sep 1, 2020

NOT READY TO BE MERGED.

@B4nan
Copy link
Member

B4nan commented Sep 2, 2020

So I managed to get all tests passing, there are some extra parens but only in those complex and/or combinations (I had to adjust only single query test in the end).

@B4nan
Copy link
Member

B4nan commented Sep 2, 2020

Btw you had one thing wrong in the tests - $not operator can't be used with arrays, if you want not (... and ...) then you need to use $not: { $and: [...] }, or just $not: { ... } as object keys will be $anded too. Following is equal:

qb.select('*').where({
  $or: [
    { $not: { name: 'value3', email: 'value4' } },
    { $not: { $and: [{ name: 'value3', email: 'value4' }] } },
  ],
});

@charmpitz
Copy link
Contributor Author

Thanks, good to know that ✌️ . I'll try the new release and let you know if I find any problems.

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

Successfully merging this pull request may close these issues.

None yet

2 participants