Consider the following jsonb object:
{
"track": {
"segments": [
{
"location": [ 47.763, 13.4034 ],
"startTime": "2018-10-14 10:05:14",
"HR": 73
},
{
"location": [ 47.706, 13.2635 ],
"startTime": "2018-10-14 10:39:21",
"HR": 135
}
]
}
}
I would like to query the object, to return only the following jsonb object, given the folloiwng paths:
track.segments.hr
{
"track": {
"segments": [
{
"HR": 73
},
{
"HR": 135
}
]
}
}
How can i formulate the query, to retrieve this kind of data from the json, and still return the json object, with only the specified paths?