2367 Functions That Modify JSON Values • JSON_MERGE_PATCH( json_doc ,  json_doc [,  json_doc ] ...) 1. If the first argument is not an object, the result of the merge is the same as if an empty object had been merged with the second argument. 2. If the second argument is not an object, the result of the merge is the second argument. 3. If both arguments are objects, the result of the merge is an object with the following members: •All members of the first object which do not have a corresponding member with the same key in the second object. •All members of the second object which do not have a corresponding key in the first object, and whose value is not the JSON  null  literal. •All members with a key that exists in both the first and the second object, and whose value in the second object is not the JSON  null  literal. The values of these members are the results of recursively merging the value in the first object with the value in the second object. For additional information, see Normalization, Merging, and Autowrapping of JSON Values. mysql>  SELECT JSON_MERGE_PATCH(’[1, 2]’, ’[true, false]’); +---------------------------------------------+ | JSON_MERGE_PATCH(’[1, 2]’, ’[true, false]’) | +---------------------------------------------+ | [true, false] | +---------------------------------------------+ mysql>  SELECT JSON_MERGE_PATCH(’{"name": "x"}’, ’{"id": 47}’); +-------------------------------------------------+ | JSON_MERGE_PATCH(’{"name": "x"}’, ’{"id": 47}’) | +-------------------------------------------------+ | {"id": 47, "name": "x"} | +-------------------------------------------------+ mysql>  SELECT JSON_MERGE_PATCH(’1’, ’true’); +-------------------------------+ | JSON_MERGE_PATCH(’1’, ’true’) | +-------------------------------+ | true | +-------------------------------+ mysql>  SELECT JSON_MERGE_PATCH(’[1, 2]’, ’{"id": 47}’); +------------------------------------------+ | JSON_MERGE_PATCH(’[1, 2]’, ’{"id": 47}’) | +------------------------------------------+ | {"id": 47} | +------------------------------------------+ JSON_MERGE_PATCH()  performs a merge as follows: For an explanation and example of the differences between this function and JSON_MERGE_PRESERVE() , see JSON_MERGE_PATCH() compared with JSON_MERGE_PRESERVE(). Note Performs an RFC 7396 compliant merge of two or more JSON documents and returns the merged result, without preserving members having duplicate keys. Raises an error if at least one of the documents passed as arguments to this function is not valid.