I am trying to create QueryBuilder query but all the time failing. I need to write query like this:
SELECT userId, COUNT(*) votes from uservotes WHERE sessionId = ? GROUP BY userId
but using QueryBuilder All that I done and somehow work it is this variant.
.createQueryBuilder('uservotes')
.select([
'uservotes.userId', 'userId',
])
.where({ sessionId: sessionId })
.groupBy('userId')
.getMany();
Will be very grateful for help