Skip to content

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

@sharan-nyn

Description

@sharan-nyn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions