Allow multiple filter to the same column.
Country = 'Japan' OR Country = 'Germany'
Isn't this already possible with the logical or thingy?
?filter[country][eq]=Japan&filter[country][logical]=or&filter[country][eq]=Germany
And even if that's not the way to do this, how about in? ?filter[country][in]=Japan,Germany
@WellingGuzman thoughts?
No, that's broken. The problem we are having here is that all fields are an "object" with all the keys being a field name, in that case if you create two filter using the same field, it will remove the first one.
The example below:
filter[country][eq]=Japan&filter[country][logical]=or&filter[country][eq]=Germany
Will end up being:
filter[country][eq]=Germany&filter[country][logical]=or
furthermore, this would be very usefull for between filters:
filter[id][between]=1,15&filter[id][between]=30,45
to get the ranges 1-15 and 30-45
At the moment it supports multiple filter for te same field. The problem it could be a bit ugly, just for the sake of the "array in url" thing:
filter[id][][between]=1,15&filter[id][][between]=30,45
Although to include ranges between 1 and 15, and 30 and 45. it should be an or.
Here where it gets ugly:
filter[id][0][between]=1,15&filter[id][0][logical]=or&filter[id][1][between]=30,45
This was implemented by https://github.com/directus/api/commit/b37f5bbb173849bf8383876185af48e26612f60b
I was thinking on trying to implement a parser to allow multiple fields without adding the array. In addiction to the default using array.
So it looks like this:
filter[id][between]=1,15&filter[id][between]=30,45
Instead of:
filter[id][][between]=1,15&filter[id][][between]=30,45
So @WellingGuzman — is this ticket complete/closed now? Should we open a new ticket for cleaning up the syntax?
So @WellingGuzman — is this ticket complete/closed now? Should we open a new ticket for cleaning up the syntax?
Yes @benhaynes, that would be ideal.
Most helpful comment
furthermore, this would be very usefull for between filters:
to get the ranges 1-15 and 30-45