JSON Utility Functions 1 row in set (0.00 sec) mysql>  SET @j = ’{"a": 10, "b": "wxyz", "c": "[true, false]"}’; Query OK, 0 rows affected (0.00 sec) mysql>  SET @j = JSON_SET(@j, ’$.a’, 10, ’$.b’, ’wxyz’, ’$.c’, ’1’); Query OK, 0 rows affected (0.00 sec) mysql>  SELECT @j, JSON_STORAGE_FREE(@j) AS Free; +----------------------------------+------+ | @j | Free | +----------------------------------+------+ | {"a": 10, "b": "wxyz", "c": "1"} | 0 | +----------------------------------+------+ 1 row in set (0.00 sec) mysql>  SELECT JSON_STORAGE_FREE(’{"a": 10, "b": "wxyz", "c": "1"}’) AS Free; +------+ | Free | +------+ | 0 | +------+ 1 row in set (0.00 sec) mysql>  CREATE TABLE jtable (jcol JSON); Query OK, 0 rows affected (0.42 sec) mysql>  INSERT INTO jtable VALUES -> (’{"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"}’); Query OK, 1 row affected (0.04 sec) mysql>  SELECT -> jcol, -> JSON_STORAGE_SIZE(jcol) AS Size, -> JSON_STORAGE_FREE(jcol) AS Free ->  FROM jtable; +-----------------------------------------------+------+------+ | jcol | Size | Free | +-----------------------------------------------+------+------+ | {"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"} | 47 | 0 | 2390 To illustrate this function’s behavior when used with a  JSON  column as its argument, we create a table named  jtable  containing a  JSON  column  jcol , insert a JSON value into the table, then obtain the storage space used by this column with  JSON_STORAGE_SIZE() , as shown here: An error results when  json_val  is not  NULL , and is not—or cannot be successfully parsed as—a JSON document. This function returns the number of bytes used to store the binary representation of a JSON document. When the argument is a  JSON  column, this is the space used to store the JSON document as it was inserted into the column, prior to any partial updates that may have been performed on it afterwards. json_val  must be a valid JSON document or a string which can be parsed as one. In the case where it is string, the function returns the amount of storage space in the JSON binary representation that is created by parsing the string as JSON and converting it to binary. It returns  NULL  if the argument is NULL . For a JSON literal, this function always returns 0: Partial updates of JSON documents can be performed only on column values. For a user variable that stores a JSON value, the value is always completely replaced, even when the update is performed using JSON_SET() : • JSON_STORAGE_SIZE( json_val )