The following table describes the JSON functions supported by the MySQL mode of OceanBase Database.
| Function | Description |
|---|---|
| JSON_ARRAY | Creates a JSON array. |
| JSON_ARRAYAGG | Aggregates result sets into a JSON array. |
| JSON_ARRAY_APPEND | Appends the specified values to a JSON document. |
| JSON_APPEND | Appends the specified values to a JSON document. |
| JSON_ARRAY_INSERT | Inserts an array into a JSON document. |
| JSON_CONTAINS | Verifies whether the specified JSON document is contained in the target JSON document. |
| JSON_CONTAINS_PATH | Verifies whether data in the specified path is contained in the specified JSON document. |
| JSON_DEPTH | Returns the maximum depth of a JSON document. |
| JSON_EXTRACT | Returns data from a JSON document. |
| JSON_INSERT | Inserts data into a JSON document. |
| JSON_KEYS | Returns the keys from the specified path as an array in a JSON document. |
| JSON_LENGTH | Returns the length of a JSON document. |
| JSON_MERGE | Merges multiple JSON documents. |
| JSON_MERGE_PATCH | Merges multiple JSON documents, without preserving members that have duplicate keys. |
| JSON_MERGE_PRESERVE | Merges multiple JSON documents. |
| JSON_OBJECT | Creates a JSON object. |
| JSON_OVERLAPS | Compares two JSON documents. |
| JSON_PRETTY | Prints out a JSON document in the specified format. |
| JSON_QUOTE | Quotes a JSON document. |
| JSON_REMOVE | Removes data from a JSON document. |
| JSON_REPLACE | Replaces the existing values in a JSON document. |
| JSON_SEARCH | Returns the path to the specified string in a JSON document. |
| JSON_SET | Inserts data into a JSON document. |
| JSON_STORAGE_SIZE | Returns the number of binary bytes used to store a JSON document. |
| JSON_TABLE | Extracts data from a JSON document and returns a relational table with the specified columns. |
| JSON_TYPE | Returns the type of a JSON value. |
| JSON_UNQUOTE | Unquotes a JSON value. |
| JSON_VALUE | Extracts a value in a JSON document from the specified path and returns the extracted value. |
| JSON_VALID | Verifies whether an input value is a valid JSON value. |
| JSON_OBJECTAGG | Returns a JSON object containing a key-value pair. |
| MEMBER OF | Verifies whether a value exists in a JSON array. It returns 1 if the retrieved value exists in the specified JSON array. Otherwise, it returns 0. |
| JSON_SCHEMA_VALIDATION_REPORT | Returns 1 if a JSON document validates against the specified JSON schema and 0 if the validation fails. |
| JSON_SCHEMA_VALID | Returns a report in the JSON format on the validation against the specified JSON schema. |