Dor Meiri
08/13/2022, 8:19 PMSELECT AVG(LENGTH(value)) FROM Word
Maybe something similar to
prisma.word.aggregate({
_avg: { value: { length: true } }
});
Raphael Etim
08/15/2022, 9:17 AMQueryRaw
for this operation. For example:
const result = await prisma.$queryRaw`SELECT AVG(LENGTH(value)) FROM Word;
Dor Meiri
08/15/2022, 9:58 AMQueryRaw
can be bit messy.
Is there an ORM-ish way of doing it?Raphael Etim
08/15/2022, 10:26 AMRaphael Etim
08/30/2022, 4:17 AMQueryRaw
will be best in handling this but you can open a feature request so our team can look into implementing this.