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

Filtering with OR #144

Open
matdrapeau opened this issue Aug 3, 2018 · 3 comments
Open

Filtering with OR #144

matdrapeau opened this issue Aug 3, 2018 · 3 comments

Comments

@matdrapeau
Copy link

How can I filter using OR on multiple attributes?

@lyschoening
Copy link
Contributor

That is not supported. You can write a custom filter if you would like this functionality.

@matdrapeau
Copy link
Author

@lyschoening How would you represent the api syntax in order to support OR filters?

@matdrapeau
Copy link
Author

@lyschoening What about a list to represent OR expressions?

searching for author AND title:
/books?where={"author": {"$contains": "John"}, "title": {"$contains": "Python"}}

searching for author OR title:
/books?where=[{"author": {"$contains": "John"}}, {"title": {"$contains": "Python"}}]

searching for author OR (title AND description) expressions:
/books?where=[{"author": {"$contains": "John"}}, {"title": {"$contains": "Python"}, "description": {"$contains": "Python"}}]

searching for (author AND title) OR (title AND description) expressions:
/books?where=[{"author": {"$contains": "John"}, "title": {"$contains": "Python"}}, {"title": {"$contains": "Python"}, "description": {"$contains": "Python"}}]

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