We can't replace json_get(x, y) is null with NOT json_contains(x, y) because
select json_get('{"foo": null}', 'foo') is null -- true
select not json_contains('{"foo": null}', 'foo') -- false
-- or equivilantly
select json_get('{"foo": null}', 'foo') is not null -- false
select json_contains('{"foo": null}', 'foo') -- true
So we need a new method json_contains_not_null which is true if the value exists in the JSON, but is not null.
Then we can do the substitution.
We can't replace
json_get(x, y) is nullwithNOT json_contains(x, y)becauseSo we need a new method
json_contains_not_nullwhich is true if the value exists in the JSON, but is notnull.Then we can do the substitution.