Searching and Modifying JSON Values As mentioned previously, path components that name keys must be quoted if the unquoted key name is not legal in path expressions. Let  $  refer to this value: The keys both contain a space and must be quoted: Paths that use wildcards evaluate to an array that can contain multiple values: In the following example, the path  $**.b  evaluates to multiple paths ( $.a.b  and  $.c.b ) and produces an array of the matching path values: mysql>  SELECT JSON_EXTRACT(’{"a": 1, "b": 2, "c": [3, 4, 5]}’, ’$.*’); +---------------------------------------------------------+ | JSON_EXTRACT(’{"a": 1, "b": 2, "c": [3, 4, 5]}’, ’$.*’) | +---------------------------------------------------------+ | [1, 2, [3, 4, 5]] | +---------------------------------------------------------+ mysql>  SELECT JSON_EXTRACT(’{"a": 1, "b": 2, "c": [3, 4, 5]}’, ’$.c[*]’); +------------------------------------------------------------+ | JSON_EXTRACT(’{"a": 1, "b": 2, "c": [3, 4, 5]}’, ’$.c[*]’) | +------------------------------------------------------------+ | [3, 4, 5] | +------------------------------------------------------------+ mysql>  SELECT JSON_EXTRACT(’{"a": {"b": 1}, "c": {"b": 2}}’, ’$**.b’); +---------------------------------------------------------+ | JSON_EXTRACT(’{"a": {"b": 1}, "c": {"b": 2}}’, ’$**.b’) | +---------------------------------------------------------+ | [1, 2] | +---------------------------------------------------------+ mysql>  SELECT JSON_EXTRACT(’[1, 2, 3, 4, 5]’, ’$[1 to 3]’); +----------------------------------------------+ | JSON_EXTRACT(’[1, 2, 3, 4, 5]’, ’$[1 to 3]’) | +----------------------------------------------+ | [2, 3, 4] | +----------------------------------------------+ 1 row in set (0.00 sec) Ranges from JSON arrays.   You can use ranges with the  to  keyword to specify subsets of JSON arrays. For example,  $[1 to 3]  includes the second, third, and fourth elements of an array, as shown here: The syntax is  M  to  N , where  M  and  N  are, respectively, the first and last indexes of a range of elements from a JSON array.  N  must be greater than  M ;  M  must be greater than or equal to 0. Array elements are indexed beginning with 0. You can use ranges in contexts where wildcards are supported. Rightmost array element.   The  last  keyword is supported as a synonym for the index of the last element in an array. Expressions of the form  last -  N  can be used for relative addressing, and within range definitions, like this: mysql>  SELECT JSON_EXTRACT(’[1, 2, 3, 4, 5]’, ’$[last-3 to last-1]’); +--------------------------------------------------------+ | JSON_EXTRACT(’[1, 2, 3, 4, 5]’, ’$[last-3 to last-1]’) | 2077 {"a fish": "shark", "a bird": "sparrow"} • $[2][0]  evaluates to  99 . • $."a fish"  evaluates to  shark . • $."a bird"  evaluates to  sparrow .