I am facing an issue with MySQL JSON_SEARCH function, which does not support the boolean value search.
Please refer this SQL: https://rextester.com/DYLPJG17389
Here is database schema:
create table if not exists superheroes (
name varchar(32),
attributes JSON
);
insert into superheroes
values ('Batman', '{"dead": "false", "orphan": true, "billionaire": "true", "goodboy" : "true"}');
SELECT JSON_SEARCH(attributes, 'all', 'true')
FROM superheroes
WHERE name = 'Batman';
drop table superheroes;
Right now result has:
["$.goodboy", "$.billionaire"]
I need my result should have "$.orphan"
I can't replace true with "true" as JSON data are coming from the external source.
Thank you in advance.
"orphan": "true"within the json column. Refer this