ppetzold/nestjs-paginate

ilike operator breaks with numeric column

natoszme opened this issue · 4 comments

Hi there!

First of all, thank you for such a great library!

I started to use it a couple of days ago and I'd like to know whether it's possible to add operators to the search param.

My use case is as follows: I want to be able to search by a string with several words, and since search doesn't support $in operator, it's doing the default like with %{string}% comparison but with the full string (with spaces). Each word is a sub-string I want to search in a different column (that's why supporting $in operator in search would be a possible solution).

I tried manually doing the filter in the client, specifying each searchableColumn as a separate filter query param, but the numeric columns break (I want my search input to support id's, which works great with the search feature) .

Maybe there is a different approach to this problem using already existing features?

Thanks!

.Oh I see - would consider this a bug of the $ilike operator then. should add string/text cast.

happy to accept PR :)