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

Complex queries -- Specific syntax needed for 'AND' #161

Open
sharan-nyn opened this issue Aug 4, 2019 · 1 comment
Open

Complex queries -- Specific syntax needed for 'AND' #161

sharan-nyn opened this issue Aug 4, 2019 · 1 comment

Comments

@sharan-nyn
Copy link

Hi,
I am converting SQL WHERE clause to TaffyDB queries. I think I have found one possible combination that cannot be implemented into a TaffyDB query.

A query like:

(Type='Food' OR Amount=27) AND (Currency='INR' OR Amount=26)

can be converted to TaffyDB query as:

[
  [{"Type":{"==":"Food"}}, {"Amount":{"==":27}}],
  [{"Currency":{"==":"INR"}, {"Amount":{"==":26}}]
]

the [...] is used to group two filters in an 'OR' condition and 'comma' separation works like 'AND' in this case.

However query like:

(Type='Food' AND Amount=27) OR (Currency='INR' AND Amount=26)

Cannot be converted to TaffyDB query, since there is no specific syntax for 'AND' like 'OR' in
TaffyDB.

@mmikowski
Copy link
Collaborator

Agreed. I believe one could write a callback function to sort, but this would be useful in the core.

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