mysql json_contains code example
Example 1: mysql json array contains
JSON_CONTAINS('[1,2,3,4,5]','7','$') Returns: 0
JSON_CONTAINS('[1,2,3,4,5]','1','$') Returns: 1
Example 2: mysql json extract escape
SELECT JSON_EXTRACT('{"user.name": "Aztalan"}', '$."user.name"');
Example 3: json_extract in non native query
Query query = em.createQuery("select o from Product o FUNCTION('JSON_EXTRACT', o.des, '$.org') = :org");