In my Entity
I have Column
@Column({ type: 'jsonb', default: [] })
solutionFormats: Array<SolutionFormats>;
where
export enum SolutionFormats {
VIDEO = 'VIDEO',
IMAGE = 'IMAGE',
LATEX = 'LATEX',
}
I want to do grouping by values in this solutionFormats
column and count results, i.e. if I have 2 rows whith solutionFormats
being [LATEX, VIDEO]
, [LATEX]
, the output should be {LATEX: 2, VIDEO: 1}
. How to do it? I have already a proplerly filtered queryBuilder
object and I want to do this grouping on solutionFormats
column.