I have entity One that has one-to-many relation to entity Two. I want to select entity One and a COUNT of Two. I don't want all the data from Two - I'm getting lot of results and Two is large.
What's the best way to do this with TypeORM?
When I use QueryBuilder, I can get the COUNT with getRawMany(), but then all the entity columns are prefixed with alias, simple arrays are not converted etc. - inconvenient.
getMany() will omit the COUNT as it's not part of the entity structure. Can I somehow define a virtual column for the COUNT so it does get included?