JSON_PATH
JSON オブジェクトからデータを抽出します。
構文
JSON_PATH(path, JSON)
引数
| 名前 | 型 | 説明 | 既定値 |
|---|---|---|---|
| path | string | JSON パス式 | |
| JSON | string | JSON ドキュメントを含む文字列 |
例
| path | JSON | 出力 |
|---|---|---|
"$[*].author.name"
|
"[{"name": "The Great Gatsby", "author": {"name": "F. Scott Fitzgerald"}}, {"name": "Nineteen Eighty-Four", "author": {"name": "George Orwell"}}]
|
[F. Scott Fitzgerald, George Orwell]
|
"net_id"
|
"{ "net_id": 41 }"
|
41
|
"net_id"
|
"{ "net_id": [41, 42] }"
|
[41,42]
|
"net_id[*]"
|
"{ "net_id": [41, 42] }"
|
[41, 42] |
"net_id.parent"
|
"{ "net_id": [41, 42] }"
|
null |
"$[*]"
|
"[1,2,3]"
|
[1, 2, 3] |
"$[*].author"
|
"[{"name":"The Great Gatsby", "author":{"name": "F. Scott Fitzgerald"}}, {"name":"Nineteen Eighty-Four", "author": {"name": "George Orwell"}}]
|
[{"name":"F. Scott Fitzgerald"}, {"name":"George Orwell"}]
|