-
Notifications
You must be signed in to change notification settings - Fork 704
functions-and-operators: remove MySQL Reference Manual links #21821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,7 +7,7 @@ summary: Learn about JSON functions that aggregate JSON values. | |||||
|
||||||
The functions listed on this page are part of the [aggregate functions](/functions-and-operators/aggregate-group-by-functions.md) that TiDB supports, but are specific to working with JSON. | ||||||
|
||||||
## [JSON_ARRAYAGG()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-arrayagg) | ||||||
## JSON_ARRAYAGG() | ||||||
|
||||||
The `JSON_ARRAYAGG(key)` function aggregates values of keys into a JSON array according to the given `key`. `key` is typically an expression or a column name. | ||||||
|
||||||
|
@@ -28,7 +28,7 @@ SELECT JSON_ARRAYAGG(v) FROM (SELECT 1 'v' UNION SELECT 2); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_OBJECTAGG()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-objectagg) | ||||||
## JSON_OBJECTAGG() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_OBJECTAGG(key,value)` function aggregates keys and values of keys into a JSON object according to the given `key` and `value`. Both `key` or `value` are typically an expression or a column name. | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,7 +7,7 @@ summary: Learn about JSON functions that create JSON values. | |||||
|
||||||
This document describes JSON functions that create JSON values. | ||||||
|
||||||
## [JSON_ARRAY()](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-array) | ||||||
## JSON_ARRAY() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_ARRAY([val[, val] ...])` function evaluates a (possibly empty) list of values and returns a JSON array containing those values. | ||||||
|
||||||
|
@@ -24,7 +24,7 @@ SELECT JSON_ARRAY(1,2,3,4,5), JSON_ARRAY("foo", "bar"); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_OBJECT()](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-object) | ||||||
## JSON_OBJECT() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_OBJECT([key, val[, key, val] ...])` function evaluates a (possibly empty) list of key-value pairs and returns a JSON object containing those pairs. | ||||||
|
||||||
|
@@ -41,7 +41,7 @@ SELECT JSON_OBJECT("database", "TiDB", "distributed", TRUE); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_QUOTE()](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-quote) | ||||||
## JSON_QUOTE() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_QUOTE(str)` function returns a string as a JSON value with quotes. | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,11 +7,11 @@ summary: Learn about JSON functions that modify JSON values. | |||||
|
||||||
This document describes JSON functions that modify JSON values. | ||||||
|
||||||
## [JSON_APPEND()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-append) | ||||||
## JSON_APPEND() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
An alias to [`JSON_ARRAY_APPEND()`](#json_array_append). | ||||||
|
||||||
## [JSON_ARRAY_APPEND()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-array-append) | ||||||
## JSON_ARRAY_APPEND() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_ARRAY_APPEND(json_array, path, value [,path, value] ...)` function appends values to the end of the indicated arrays within a JSON document at the specified `path` and returns the result. | ||||||
|
||||||
|
@@ -49,7 +49,7 @@ SELECT JSON_ARRAY_APPEND('{"transport_options": ["Car", "Boat", "Train"]}', '$.t | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_ARRAY_INSERT()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-array-insert) | ||||||
## JSON_ARRAY_INSERT() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_ARRAY_INSERT(json_array, path, value [,path, value] ...)` function inserts a `value` into the specified position of the `json_array` in the `path` and returns the result. | ||||||
|
||||||
|
@@ -87,7 +87,7 @@ SELECT JSON_ARRAY_INSERT('["Car", "Boat", "Train"]', '$[1]', "Airplane") AS "Tra | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_INSERT()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-insert) | ||||||
## JSON_INSERT() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_INSERT(json_doc, path, value [,path, value] ...)` function inserts one or more values into a JSON document and returns the result. | ||||||
|
||||||
|
@@ -125,7 +125,7 @@ SELECT JSON_INSERT('{"a": 61, "b": 62}', '$.a', 41, '$.c', 63); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_MERGE_PATCH()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-merge-patch) | ||||||
## JSON_MERGE_PATCH() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_MERGE_PATCH(json_doc, json_doc [,json_doc] ...)` function merges two or more JSON documents into a single JSON document, without preserving values of duplicate keys. For `json_doc` arguments with duplicated keys, only the values from the later specified `json_doc` argument are preserved in the merged result. | ||||||
|
||||||
|
@@ -150,7 +150,7 @@ SELECT JSON_MERGE_PATCH( | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_MERGE_PRESERVE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-merge-preserve) | ||||||
## JSON_MERGE_PRESERVE() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_MERGE_PRESERVE(json_doc, json_doc [,json_doc] ...)` function merges two or more JSON documents while preserving all values associated with each key and returns the merged result. | ||||||
|
||||||
|
@@ -171,15 +171,15 @@ SELECT JSON_MERGE_PRESERVE('{"a": 1, "b": 2}','{"a": 100}', '{"c": 300}'); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_MERGE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-merge) | ||||||
## JSON_MERGE() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
> **Warning:** | ||||||
> | ||||||
> This function is deprecated. | ||||||
|
||||||
A deprecated alias for [`JSON_MERGE_PRESERVE()`](#json_merge_preserve). | ||||||
|
||||||
## [JSON_REMOVE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-remove) | ||||||
## JSON_REMOVE() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_REMOVE(json_doc, path [,path] ...)` function removes data of the specified `path` from a JSON document and returns the result. | ||||||
|
||||||
|
@@ -215,7 +215,7 @@ SELECT JSON_REMOVE('{"a": 61, "b": 62, "c": 63}','$.b','$.c'); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_REPLACE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-replace) | ||||||
## JSON_REPLACE() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_REPLACE(json_doc, path, value [, path, value] ...)` function replaces values in specified paths of a JSON document and returns the result. If a specified path does not exist, the value corresponding to the path is not added to the result. | ||||||
|
||||||
|
@@ -253,7 +253,7 @@ SELECT JSON_REPLACE('{"a": 41, "b": 62}','$.b',42,'$.c',43); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_SET()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-set) | ||||||
## JSON_SET() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_SET(json_doc, path, value [,path, value] ...)` function inserts or updates data in a JSON document and returns the result. | ||||||
|
||||||
|
@@ -291,7 +291,7 @@ SELECT JSON_SET('{"version": 1.1, "name": "example"}','$.version',1.2,'$.branch' | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_UNQUOTE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-unquote) | ||||||
## JSON_UNQUOTE() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_UNQUOTE(json)` function unquotes a JSON value and returns the result as a string. This is the opposite of the [`JSON_QUOTE()`](/functions-and-operators/json-functions/json-functions-create.md#json_quote) function. | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,7 +7,7 @@ summary: Learn about JSON functions that return JSON values. | |||||
|
||||||
This document describes JSON functions that return JSON values. | ||||||
|
||||||
## [JSON_DEPTH()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-depth) | ||||||
## JSON_DEPTH() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_DEPTH(json_doc)` function returns the maximum depth of a JSON document. | ||||||
|
||||||
|
@@ -32,7 +32,7 @@ SELECT JSON_DEPTH('{"weather": {"current": "sunny"}}'); | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_LENGTH()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-length) | ||||||
## JSON_LENGTH() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_LENGTH(json_doc [,path])` function returns the length of a JSON document. If a `path` argument is given, it returns the length of the value within the path. | ||||||
|
||||||
|
@@ -68,7 +68,7 @@ SELECT JSON_LENGTH('{"weather": {"current": "sunny", "tomorrow": "cloudy"}}','$. | |||||
1 row in set (0.01 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_TYPE()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-type) | ||||||
## JSON_TYPE() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_TYPE(json_val)` function returns a string indicating [the type of a JSON value](/data-type-json.md#json-value-types). | ||||||
|
||||||
|
@@ -132,7 +132,7 @@ SELECT JSON_TYPE('"2025-06-14"'),JSON_TYPE(CAST(CAST('2025-06-14' AS date) AS js | |||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## [JSON_VALID()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-valid) | ||||||
## JSON_VALID() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||
|
||||||
The `JSON_VALID(str)` function checks if the argument is valid JSON. This can be useful for checking a column before converting it to the `JSON` type. | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To adhere to the style guide, function and operator names in headings should be enclosed in backticks for proper code formatting.1
Style Guide References
Footnotes
The style guide specifies that code snippets, command names, options, and paths should be enclosed in backticks. ↩