You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MySQL allows querying a property from a JSON field using special syntax, for example, like so SELECT col->"$.mascot" FROM qtest. In our system, we use normal columns to narrow down results to just a few hundreds rows, but then apply a few JSON filters to further filter and sort records based on the values in the JSON fields. The value stored in JSON is dynamic, and it's not feasible to extract it into a column.
The query looks something like this:
SELECT * FROM records WHERE scope = ? AND data->'$.r_12345' != 0 ORDER BY data->'$.r_12345' ASC
I can add a filter by JSON field using rel.FilterFragment API, but unfortunately, there is nothing similar for ORDER BY portion.
What would be the best way to implement it, and is there a workaround? For example, adding support for col->"..." to a field escape function or maybe just adding support for rel.OrderFragment?
The text was updated successfully, but these errors were encountered:
MySQL allows querying a property from a JSON field using special syntax, for example, like so
SELECT col->"$.mascot" FROM qtest
. In our system, we use normal columns to narrow down results to just a few hundreds rows, but then apply a few JSON filters to further filter and sort records based on the values in the JSON fields. The value stored in JSON is dynamic, and it's not feasible to extract it into a column.The query looks something like this:
I can add a filter by JSON field using
rel.FilterFragment
API, but unfortunately, there is nothing similar forORDER BY
portion.What would be the best way to implement it, and is there a workaround? For example, adding support for
col->"..."
to a field escape function or maybe just adding support forrel.OrderFragment
?The text was updated successfully, but these errors were encountered: