I have a PostgreSQL table with each row containing JSON objects that look something like this:
{
"Metadata":{
...
},
"NestedArray":[
{
...,
...,
"Coordinates":[
{
"id":"1000",
"X":"...",
"Y":"..."
},
{
"id":"1001",
"X":"...",
"Y":"..."
},
{
"id":"1003",
"X":"...",
"Y":"..."
}
]
}
]
}
So each object contains a NestedArray, which contains another nested array called Coordinates.
MyObject.NestedArray[].Coordinates[]
What I'm trying to do is query a JSON column in my PostgreSQL table that contains objects such as the one above, and get a resultset of all Coordinates objects.
So this is essentially what I want to end up with:
| id | X | Y |
|---|---|---|
| 1001 | . | . |
| 1002 | . | . |
| 1003 | . | . |
| 1004 | . | . |
| 1005 | . | . |
| 1006 | . | . |
How do I go about doing this?