Searching and Modifying JSON Values +--------------------------------------------------------+ | [2, 3, 4] | +--------------------------------------------------------+ 1 row in set (0.01 sec) If the path is evaluated against a value that is not an array, the result of the evaluation is the same as if the value had been wrapped in a single-element array: You can use  column -> path  with a JSON column identifier and JSON path expression as a synonym for JSON_EXTRACT( column ,  path ) . See Section 12.18.3, “Functions That Search JSON Values” , for more information. See also Indexing a Generated Column to Provide a JSON Column Index. Some functions take an existing JSON document, modify it in some way, and return the resulting modified document. Path expressions indicate where in the document to make changes. For example, the JSON_SET() ,  JSON_INSERT() , and  JSON_REPLACE()  functions each take a JSON document, plus one or more path-value pairs that describe where to modify the document and the values to use. The functions differ in how they handle existing and nonexisting values within the document. +-----------------------------------------+ | JSON_REPLACE(’"Sakila"’, ’$[last]’, 10) | +-----------------------------------------+ | 10 | +-----------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT JSON_REPLACE(’"Sakila"’, ’$[last]’, 10); mysql> SET @j = ’["a", {"b": [true, false]}, [10, 20]]’; mysql>  SELECT JSON_SET(@j, ’$[1].b[0]’, 1, ’$[2][2]’, 2); mysql>  SELECT JSON_INSERT(@j, ’$[1].b[0]’, 1, ’$[2][2]’, 2); mysql>  SELECT JSON_REPLACE(@j, ’$[1].b[0]’, 1, ’$[2][2]’, 2); +--------------------------------------------+ | JSON_SET(@j, ’$[1].b[0]’, 1, ’$[2][2]’, 2) | +--------------------------------------------+ | ["a", {"b": [1, false]}, [10, 20, 2]] | +--------------------------------------------+ +-----------------------------------------------+ | JSON_INSERT(@j, ’$[1].b[0]’, 1, ’$[2][2]’, 2) | +-----------------------------------------------+ | ["a", {"b": [true, false]}, [10, 20, 2]] | +-----------------------------------------------+ +------------------------------------------------+ | JSON_REPLACE(@j, ’$[1].b[0]’, 1, ’$[2][2]’, 2) | +------------------------------------------------+ | ["a", {"b": [1, false]}, [10, 20]] | +------------------------------------------------+ JSON_SET()  replaces values for paths that exist and adds values for paths that do not exist:. Consider this document: In this case, the path  $[1].b[0]  selects an existing value ( true ), which is replaced with the value following the path argument ( 1 ). The path  $[2][2]  does not exist, so the corresponding value ( 2 ) is added to the value selected by  $[2] . JSON_INSERT()  adds new values but does not replace existing values: JSON_REPLACE()  replaces existing values and ignores new values: The path-value pairs are evaluated left to right. The document produced by evaluating one pair becomes the new value against which the next pair is evaluated. 2078