JSON_PATH
Extrai dados de objetos JSON.
Sintaxe
JSON_PATH(path, JSON)
Argumentos
| Nome | Tipo | Descrição | Valor padrão |
|---|---|---|---|
| path | caractere | Expressão de Caminho JSON | |
| JSON | caractere | Uma string que contém Documento JSON |
Exemplos
| path | JSON | Saída |
|---|---|---|
"$[*].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] }"
|
nulo |
"$[*]"
|
"[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"}]
|