I'm wondering if I can retrieve multiple fields from postgres jsonb column. The jsonb dats format is something like:
{
...
"teamId": 12,
"teamName": "super team",
"teamMembers": [
{
...
"memberId": 34,
"externalId": 7783,
"firstname": "John",
"lastname": "Doe"
...
}
]
...
}
What I'm trying to do is to fetch only teamId, memberId, externalId fields skipping all other fields.
This database is really huge so I'm trying to optimise this query to speed it up and reduce network load.
With a jsonpath plus I could fetch members fields with something like thus: $.teamMembers.[teamId, externalId] but it seems postgres doesn't support such a syntax.
jsonb_to_recordset(example A, example B)