You are viewing the archived documentation of TiDB, which no longer receives updates. It is recommended that you use the latest LTS version of the TiDB database.
JSON Functions
Warning
This is still an experimental feature. It is NOT recommended that you use it in the production environment.
TiDB supports most of the JSON functions that shipped with the GA release of MySQL 5.7. Additional JSON functions were added to MySQL 5.7 after its release, and not all are available in TiDB (see unsupported functions).
Checks if a json_doc is valid JSON. Useful for checking a column before converting it to the json type.
Utility Functions
Function Name
Description
[JSON_STORAGE_SIZE(json_doc)][json_storage_size]
Returns an approximate size of bytes required to store the json value. As the size does not account for TiKV using compression, the output of this function is not strictly compatible with MySQL.
Aggregate Functions
Function Name
Description
[JSON_OBJECTAGG(key, value)][json_objectagg]
Provides an aggregation of values for a given key.
Unsupported functions
The following JSON functions are unsupported in TiDB. You can track the progress in adding them in TiDB #7546: