In a jsonb column, how can I query with the "LIKE" upon the value if the value is a string? #24
Labels
next-up-for-ama
This question is next up for an AMA session.
question
Further information is requested
If I have a jsonb field/column, but the value is, in some cases, a string, e.g. "abc123". I'd like to be able to query that value with something like the "LIKE" query on it. From what I can find, this is supported by Postgres and requires you to basically cast the field/value as "text" and then you can do the "LIKE" query, see https://stackoverflow.com/a/57562423/1374827 for an example. For cases where the field value was not a string (e.g. it's a float, or array, or object), I wouldn't really care how Hasura behaved, although I would assume it would make sense that it would still cast the value as text and then attempt to perform a "LIKE" query on the result. The overall outcome that would be great is if like and _ilike were available as new options for the where parameter for jsonb fields/columns, i.e. if they were added to jsonb_comparison_exp. Will this be available in the future?
The text was updated successfully, but these errors were encountered: