Purpose
You can call this function to unquote a JSON value and return the result in a UTF8MB4 string.
Syntax
JSON_UNQUOTE(json_val)
Notes
json_val specifies the quoted JSON value. If the argument is NULL, NULL is returned.
If the value starts and ends with double quotation marks ('') but is not a valid JSON string literal, an error occurs.
Examples
obclient> SET @jn = '"abcd"';
Query OK, 0 rows affected
obclient> SELECT @jn, JSON_UNQUOTE(@jn);
+--------+-------------------+
@jn JSON_UNQUOTE(@jn)
+--------+-------------------+
"abcd" abcd
+--------+-------------------+
1 row in set
obclient> SET @jn = '[1, 2, 3, 4]';
Query OK, 0 rows affected
obclient> SELECT @jn, JSON_UNQUOTE(@jn);
+--------------+-------------------+
@jn JSON_UNQUOTE(@jn)
+--------------+-------------------+
[1, 2, 3, 4] [1, 2, 3, 4]
+--------------+-------------------+
1 row in set