I'm new to hasura and i'm searching how to relate a table with a column of int of array to another table.
I want to return
products { id
name
number of users
}
I'm new to hasura and i'm searching how to relate a table with a column of int of array to another table.
I want to return
products { id
name
number of users
}
Looks like you need a user_products
table. Hasura is meant to track relations in a relational database. Your schema is not the way a many-to-many relationship is accomplished. Have a look at Hasura's docs for a clear explanation although this is more of a general relational database concept than strictly a Hasura thing.
If you absolutely must use this schema, you can make a View and track it in Hasura. In your View, you can UNNEST product_ids
(which will make a unique row for each id,product_id
pair) and make the correct many-to-many relationships which you can then aggregate in hasura. This is not at all advisable.