kurierjs / kurier

TypeScript framework to create JSON:API compliant APIs
https://kurier.readthedocs.io/en/latest/
MIT License
61 stars 9 forks source link

Support multiple filters for the same attribute #377

Open JesseDocken opened 6 months ago

JesseDocken commented 6 months ago

I'm working on a new JSON-API application on top of ElasticSearch. So far I've got it to the point where it's able to properly query and return results from the database, however when I try to implement a query like:

filter[age]=gt:18&filter[age]=lt:35

The first filter gets replaced by the second. This isn't ideal and so far I haven't been able to find a way around it. Ideally I'd expect the op.params.filter to look something like:

{
  age: [ "gt:18", "lt:35" ]
}

That would be fairly straightforward to parse through and would make it easy to detect if the queries could be combined into a range operator under the covers, for example.