MySQL JSON Functions
This page lists MySQL JSON functions that perform operations on JSON values.
-
JSON_ARRAY
The MySQLJSON_ARRAY()
function returns a JSON array that includes all parameters. -
JSON_ARRAY_APPEND
The MySQLJSON_ARRAY_APPEND()
function appends a value to a array in a JSON document, specified by a path, and returns the modified JSON document. -
JSON_ARRAY_INSERT
The MySQLJSON_ARRAY_INSERT()
function inserts a value into a specified array in a given JSON document and returns a new JSON document. -
JSON_CONTAINS
The MySQLJSON_CONTAINS()
function checks whether one JSON document contains another JSON document. -
JSON_CONTAINS_PATH
The MySQLJSON_CONTAINS_PATH()
function checks whether a JSON document has a specified path. -
JSON_DEPTH
The MySQLJSON_DEPTH()
function returns the maximum depth of a JSON document. -
JSON_EXTRACT
The MySQLJSON_EXTRACT()
function extracts the data specified by the path expression in the JSON document and returns it. -
JSON_INSERT
The MySQLJSON_INSERT()
function inserts data into a JSON document and return a new JSON document. -
JSON_KEYS
The MySQLJSON_KEYS()
function returns an array containing all top-level keys of the specified JSON object. -
JSON_LENGTH
The MySQLJSON_LENGTH()
function returns the length of the JSON document or the specified path. -
JSON_MERGE
The MySQLJSON_MERGE()
function merges two or more JSON documents and return the combined result. -
JSON_MERGE_PATCH
The MySQLJSON_MERGE_PATCH()
function performs a replace merge on two or more JSON documents and returns the merged result. -
JSON_MERGE_PRESERVE
The MySQLJSON_MERGE_PRESERVE()
function merges two or more JSON documents and return the combined result. -
JSON_OBJECT
The MySQLJSON_OBJECT()
function returns a JSON object containing all the key-value pairs specified by parameters. -
JSON_OVERLAPS
The MySQLJSON_OVERLAPS()
function detects whether two JSON documents have any of the same key-value pairs or array elements. -
JSON_PRETTY
The MySQLJSON_PRETTY()
function returns the specified JSON document with a pretty format. -
JSON_QUOTE
The MySQLJSON_QUOTE()
function wraps a value with double quote and returns it as a JSON string value. -
JSON_REMOVE
The MySQLJSON_REMOVE()
function removes the data specified by the path from a JSON document and returns the modified JSON document. -
JSON_REPLACE
The MySQLJSON_REPLACE()
function replaces existing data specified by the path in a JSON document and return the modified JSON document. -
JSON_SCHEMA_VALID
The MySQLJSON_SCHEMA_VALID()
function verifies a JSON document according to the specified JSON schema. -
JSON_SCHEMA_VALIDATION_REPORT
The MySQLJSON_SCHEMA_VALIDATION_REPORT()
function validates a JSON document against a specified JSON schema and returns a validation report. -
JSON_SEARCH
The MySQLJSON_SEARCH()
function returns the path of a given string in a JSON document. -
JSON_SET
The MySQLJSON_SET()
function inserts or updates data in a JSON document and return a new JSON document. -
JSON_STORAGE_FREE
The MySQLJSON_STORAGE_FREE()
function returns the space freed after a JSON column has been updated byJSON_SET()
, orJSON_REPLACE()
, orJSON_REMOVE()
. -
JSON_STORAGE_SIZE
The MySQLJSON_STORAGE_SIZE()
function returns the number of bytes used to store the binary representation of a JSON document. -
JSON_TABLE
The MySQLJSON_TABLE()
function extracts data from a specified JSON document and returns a relational table with the specified columns. -
JSON_TYPE
The MySQLJSON_TYPE()
function returns the type of a given JSON value. -
JSON_UNQUOTE
The MySQLJSON_UNQUOTE()
function unquotes a JSON value and returns the result as a utf8mb4 string. -
JSON_VALID
The MySQLJSON_VALID()
function returns 0 and 1 to indicate whether the given parameter is a valid JSON document. -
JSON_VALUE
The MySQLJSON_VALUE()
function extracts the value of the specified path from a specified JSON document and returns it. -
MEMBER OF
The MySQLMEMBER OF()
function checks whether a specified value is an element of a JSON array.