JSON_PATH
Extracts data from JSON objects.
Syntax
Arguments
Name | Type | Description | Default Value |
---|---|---|---|
path | string | JSON Path Expression | |
JSON | string | A string that contains JSON Document |
Examples
path | JSON | Output |
---|---|---|
'$[*].author.name' | '[{ | |
"name": "The Great Gatsby", | ||
"author": { | ||
"name": "F. Scott Fitzgerald" | ||
} | ||
}, | ||
{ | ||
"name": "Nineteen Eighty-Four", | ||
"author": { | ||
"name": "George Orwell" | ||
} | ||
}]' | [ | |
'net_id' | '{ "net_id": 41 }' |
|
'net_id' | '{ "net_id": [41, 42] }' |
|
'net_id[*]' | '{ "net_id": [41, 42] }' | [ |
'net_id.parent' | '{ "net_id": [41, 42] }' | null |
'$[*]' | '[1,2,3]' | [ |
'$[*].author' | '[{ | |
"name": "The Great Gatsby", | ||
"author": { | ||
"name": "F. Scott Fitzgerald" | ||
} | ||
}, | ||
{ | ||
"name": "Nineteen Eighty-Four", | ||
"author": { | ||
"name": "George Orwell" | ||
} | ||
}]' | [ |
Transformation job example
SQL
Query result
path | JSON | Output |
---|---|---|
'$[*].author.name' | '[{ | |
"name": "The Great Gatsby", | ||
"author": { | ||
"name": "F. Scott Fitzgerald" | ||
} | ||
}, | ||
{ | ||
"name": "Nineteen Eighty-Four", | ||
"author": { | ||
"name": "George Orwell" | ||
} | ||
}]' | [ |
Last updated