I want to write a query that can loop over a list of dictionaries in jsonb object and extract all values that match a specific condition. The table has the following structure.
UniqueID | Configuration |
---|---|
uid1 | [{...}, {...}, {...}] |
uid2 | [{...}, {...}, {...}] |
The list of dictionaries looks like following for each uid.
[
{'insType': 1, 'insMode': 2, 'insOffset': 0.0},
{'insType': 2, 'insMode': 4, 'insOffset': 1.0},
{'insType': 2, 'insMode': 5, 'insOffset': 0.0},
{'insType': 3, 'insMode': 2, 'insOffset': 3.0},
{'insType': 3, 'insMode': 0, 'insOffset': -1.0},
]
I want to find the 'insOffset' for 'insType' == 2 for all my unique ids.
Is there even a way to do it as a query?