ppetzold / nestjs-paginate

Pagination and filtering helper method for TypeORM repositories or query builders using Nest.js framework :book::paperclip:
MIT License
403 stars 88 forks source link

ilike operator breaks with numeric column #918

Open natoszme opened 2 months ago

natoszme commented 2 months ago

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!

ppetzold commented 2 months ago

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

happy to accept PR :)