How to convert a MySQL 5.7 JSON NULL to native MySQL NULL?
Unfortunately CAST('{}' AS JSON)
will not work is this case,
but NULLIF
works:
Full methods:
SELECT NULLIF(JSON_UNQUOTE(JSON_EXTRACT('{"hello": null}', '$.hello')), 'null') IS NULL;
Shorted:
SELECT NULLIF(helloColumn ->> '$.hello', 'null') IS NULL IS NULL;