Functions That Search JSON Values Returns the keys from the top-level value of a JSON object as a JSON array, or, if a  path  argument is given, the top-level keys from the selected path. Returns  NULL  if any argument is  NULL , the  json_doc argument is not an object, or  path , if given, does not locate an object. An error occurs if the  json_doc argument is not a valid JSON document or the  path  argument is not a valid path expression or contains a  *  or  **  wildcard. The result array is empty if the selected object is empty. If the top-level value has nested subobjects, the return value does not include keys from those subobjects. • JSON_KEYS( json_doc [,  path ]) • JSON_OVERLAPS( json_doc1 ,  json_doc2 ) Compares two JSON documents. Returns true (1) if the two document have any key-value pairs or array elements in common. If both arguments are scalars, the function performs a simple equality test. This function serves as counterpart to  JSON_CONTAINS() , which requires all elements of the array searched for to be present in the array searched in. Thus,  JSON_CONTAINS()  performs an  AND operation on search keys, while  JSON_OVERLAPS()  performs an  OR  operation. Queries on JSON columns of  InnoDB  tables using  JSON_OVERLAPS()  in the  WHERE  clause can be optimized using multi-valued indexes. Multi-Valued Indexes, provides detailed information and examples. When comparing two arrays,  JSON_OVERLAPS()  returns true if they share one or more array elements in common, and false if they do not: mysql>  SELECT JSON_KEYS(’{"a": 1, "b": {"c": 30}}’); +---------------------------------------+ | JSON_KEYS(’{"a": 1, "b": {"c": 30}}’) | +---------------------------------------+ | ["a", "b"] | +---------------------------------------+ mysql>  SELECT JSON_KEYS(’{"a": 1, "b": {"c": 30}}’, ’$.b’); +----------------------------------------------+ | JSON_KEYS(’{"a": 1, "b": {"c": 30}}’, ’$.b’) | +----------------------------------------------+ | ["c"] | +----------------------------------------------+ mysql>  SELECT JSON_OVERLAPS("[1,3,5,7]", "[2,5,7]"); +---------------------------------------+ | JSON_OVERLAPS("[1,3,5,7]", "[2,5,7]") | +---------------------------------------+ | 1 | +---------------------------------------+ 1 row in set (0.00 sec) mysql>  SELECT JSON_OVERLAPS("[1,3,5,7]", "[2,6,7]"); +---------------------------------------+ | JSON_OVERLAPS("[1,3,5,7]", "[2,6,7]") | +---------------------------------------+ | 1 | +---------------------------------------+ 1 row in set (0.00 sec) mysql>  SELECT JSON_OVERLAPS("[1,3,5,7]", "[2,6,8]"); +---------------------------------------+ | JSON_OVERLAPS("[1,3,5,7]", "[2,6,8]") | +---------------------------------------+ | 0 | +---------------------------------------+ 2354