Closed TahaKhanAbdalli closed 11 months ago
Hello @thevahidal , any chance of review/merge on this PR please?
It's the last feature required in order for Soul
to be compliant as a REST
backend for react-admin
@TahaKhanAbdalli Thanks for the PR, I think it's better if we use a syntax like what we have for greater than, less than, and ... queries, in those cases, we use a gt
, lt
lookup appended to the end of the field name, e.g. id_gt=...
, id_lt=...
.
I think it's a good pattern to also use in
for multiple lookup values, e.g. id__in=...
.
@IanMayo What's your opinion on this?
@TahaKhanAbdalli There's also some conflicts needed to be handled.
Would you please bump of the minor version of Soul Core to v0.6.0
@thevahidal - sure, that strategy separates how API supports single vs multiple key values, which keeps things simple.
Hello @TahaKhanAbdalli - I support @thevahidal suggestion to support multiple matching keys using the __in
operator.
I think it's a good pattern to also use
in
for multiple lookup values, e.g.id__in=...
. @IanMayo What's your opinion on this?
Aaah, @thevahidal - @TahaKhanAbdalli has pointed out two issues with this:
Soul
API to match the REST standards employed by the react-admin
front-end library, and react-admin
uses id:[2,3,4]
,
except for commas inside []
brackets. Without the brackets it's not possible to split by ,
. Aaah, hold on. This would match your recommendations: id__in=[2,3,4]
So,
@IanMayo, the __in=
is more of a nice-to-have feature and if react-admin
is already using it the way @TahaKhanAbdalli implemented it, I'm ok to move on with this.
@all-contributors please add @thevahidal for review.
@thevahidal
I've put up a pull request to add @thevahidal! :tada:
After this merge the filters in GET
/:name/rows
can also include array e.g._filters=id:[1,2,3],firstName:John,lastName:Doe
This fix has been sponsored by @IanMayo
fixes #131