From 2cdbb170719788716c48b3aaaf940fb9a7872c26 Mon Sep 17 00:00:00 2001 From: LemonLiTree Date: Tue, 16 Apr 2024 18:00:48 +0800 Subject: [PATCH] fix --- .../json-functions/json-depth.md | 94 ------------------- docs/sidebars.json | 0 .../json-functions/json-depth.md | 94 ------------------- 3 files changed, 188 deletions(-) delete mode 100644 docs/en/docs/sql-manual/sql-functions/json-functions/json-depth.md delete mode 100644 docs/sidebars.json delete mode 100644 docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-depth.md diff --git a/docs/en/docs/sql-manual/sql-functions/json-functions/json-depth.md b/docs/en/docs/sql-manual/sql-functions/json-functions/json-depth.md deleted file mode 100644 index 261c2d3014a32bb..000000000000000 --- a/docs/en/docs/sql-manual/sql-functions/json-functions/json-depth.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -{ -"title": "JSON_DEPTH", -"language": "en" -} ---- - - - -## json_depth -### description -#### Syntax - -`INT json_depth(JSON json_str)` - -returns the maximum depth of a JSON document. - -JSON_DEPTH() calculates depth according to the following rules: - -* The depth of an empty array, or an empty object, or a scalar is 1. -* The depth of an nonempty array containing only elements of depth 1 is 2. -* The depth of an nonempty object containing only member values of depth 1 is 2. -* return NULL if the argument is NULL. - -### example - -``` -mysql> select JSON_DEPTH('[]'); -+------------------+ -| json_depth('[]') | -+------------------+ -| 1 | -+------------------+ -1 row in set (0.07 sec) - -mysql> select JSON_DEPTH('1'); -+-----------------+ -| json_depth('1') | -+-----------------+ -| 1 | -+-----------------+ -1 row in set (0.09 sec) - -mysql> select JSON_DEPTH('[1, 2]'); -+----------------------+ -| json_depth('[1, 2]') | -+----------------------+ -| 2 | -+----------------------+ -1 row in set (0.05 sec) - -mysql> select JSON_DEPTH('[1, [2, 3]]'); -+---------------------------+ -| json_depth('[1, [2, 3]]') | -+---------------------------+ -| 3 | -+---------------------------+ -1 row in set (0.05 sec) - -mysql> select JSON_DEPTH('{"x": {"y": 1}}'); -+-------------------------------+ -| json_depth('{"x": {"y": 1}}') | -+-------------------------------+ -| 3 | -+-------------------------------+ -1 row in set (0.06 sec) - -mysql> select JSON_DEPTH(NULL); -+------------------+ -| json_depth(NULL) | -+------------------+ -| NULL | -+------------------+ -1 row in set (0.08 sec) -``` -### keywords -json,json_depth diff --git a/docs/sidebars.json b/docs/sidebars.json deleted file mode 100644 index e69de29bb2d1d64..000000000000000 diff --git a/docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-depth.md b/docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-depth.md deleted file mode 100644 index 0df31391ed05d80..000000000000000 --- a/docs/zh-CN/docs/sql-manual/sql-functions/json-functions/json-depth.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -{ -"title": "JSON_DEPTH", -"language": "zh-CN" -} ---- - - - -## json_depth -### description -#### Syntax - -`INT json_depth(JSON json_str)` - -返回 JSON 文档的最大深度。 - -JSON_DEPTH()根据以下规则计算深度: - -* 空数组、空对象或标量的深度为 1。 -* 仅包含深度为 1 的元素的非空数组的深度为2。 -* 仅包含深度为 1 的成员值的非空对象的深度为2。 -* NULL如果参数为 ,则该函数将返回NULL。 - -### example - -``` -mysql> select JSON_DEPTH('[]'); -+------------------+ -| json_depth('[]') | -+------------------+ -| 1 | -+------------------+ -1 row in set (0.07 sec) - -mysql> select JSON_DEPTH('1'); -+-----------------+ -| json_depth('1') | -+-----------------+ -| 1 | -+-----------------+ -1 row in set (0.09 sec) - -mysql> select JSON_DEPTH('[1, 2]'); -+----------------------+ -| json_depth('[1, 2]') | -+----------------------+ -| 2 | -+----------------------+ -1 row in set (0.05 sec) - -mysql> select JSON_DEPTH('[1, [2, 3]]'); -+---------------------------+ -| json_depth('[1, [2, 3]]') | -+---------------------------+ -| 3 | -+---------------------------+ -1 row in set (0.05 sec) - -mysql> select JSON_DEPTH('{"x": {"y": 1}}'); -+-------------------------------+ -| json_depth('{"x": {"y": 1}}') | -+-------------------------------+ -| 3 | -+-------------------------------+ -1 row in set (0.06 sec) - -mysql> select JSON_DEPTH(NULL); -+------------------+ -| json_depth(NULL) | -+------------------+ -| NULL | -+------------------+ -1 row in set (0.08 sec) -``` -### keywords -json,json_depth