I'm trying to extract subset of JSON document value based on adjacent key value.
My JSON string:
[
{
"_metadata": {
"id": 1
},
"_children": [
"A",
"B",
"C"
]
},
{
"_metadata": {
"id": 2
},
"_children": [
"X",
"Y",
"Z"
]
}
]
Is it possible to return just [X,Y,Z] when setting WHERE clause like $._metadata.id="2" ?
Thank you!
One option is:
See dbfiddle.