Lets say I have
sequelize.query('SELECT associations FROM users WHERE id = :id')
associations
is a JSONB ARRAY column
the output look like so
[
{
"role": 2,
"shop_id": 1,
"admin_id": 1,
"manager_id": null
}
]
I'd like to loop through the array and search for those associations using those ids
I'd like to perfom that whole thing in the same query.
I have a role table, shop table, users table