I am creating a table that has a features jsonb column. There will be a dynamic set of features (each row can have an unknown set of features). Each feature is boolean true/false values.
Example:
- Row 1: feature: { "happy": true, "tall": false, "motivated": true }
- Row 2: feature: { "happy": true, "fast": true, "strong": false }
- Row 3: feature: { "smart": true, "fast": true, "sleepy": false }
What would be the best way to index this column such that I can make queries to find all rows with featureX = true? All the examples I have looked up seem to need a field name to base the index on.