feathers-objection icon indicating copy to clipboard operation
feathers-objection copied to clipboard

Can I cast a field from the client side and have it reflected in the db query?

Open philipimperato opened this issue 3 years ago • 0 comments

I'm trying to search on a field using $ilike but the field is an integer.

Using Postgres

The query is simple amount::text $ilike '%100%'. I would like to be able to indicate this from the clientside, but I can't seem to figure it out as the db will always wrap it with double quotes and throw an error.

This is what the query looks like: where (("amount::text" ilike '%100%'))

This is the postgres / objection error: operator does not exist: integer ~~* unknown

philipimperato avatar Feb 23 '22 22:02 philipimperato