How to use postgres `array_agg` with typeorm?

359 views Asked by At

In NestJS I am trying to get a list of categories as an array using TypeORM.

In PostgreSQL I can just do:

'SELECT array_agg(name) AS categories FROM categories;';

Is there a way to do this with TypeORM using createQueryBuilder ?

0

There are 0 answers