Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

MySQL JSON_SEARCH boolean Issue

#MySQL 5.7.12
#please drop objects you've created at the end of the script 
#or check for their existance before creating
#'\\' is a delimiter


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;
 run  | edit  | history  | help 0