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

implement "OR" filtering #30

Closed
jamesdixon opened this issue Jan 18, 2017 · 3 comments
Closed

implement "OR" filtering #30

jamesdixon opened this issue Jan 18, 2017 · 3 comments

Comments

@jamesdixon
Copy link
Contributor

@alechirsch I know we had briefly discussed a possible API to handle the case when you want to filter on x OR y rather than x AND y.

Want to restart that discussion here and figure out an API?

@alechirsch
Copy link
Collaborator

Sure, I'd be happy to discuss it

@ErisDS
Copy link

ErisDS commented Feb 6, 2017

Throwing in an idea here:

Ghost has a filter query language that works with JSON API's ?filter= query param and supports OR queries, it's called GQL. The syntax is based on the filtering available in gmail, github and slack.

An example would be ?filter=foo:bar,bar:foo - a comma denotes an OR. ?filter=foo:bar+bar:foo - a plus denotes an AND. It does require URL encoding, however it's super flexible.

It's a bit unloved and needs a rewrite to squash some serious bugs in the first iteration, however as it's a simpler, shorter, slightly more powerful syntax I'd love to see more people make use of it.

Support could be added in this lib and in https://github.com/kideh88/node-jsonapi-query-parser.

@alechirsch
Copy link
Collaborator

#63

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

3 participants