Logan
06/01/2021, 9:42 PMresult = *await* client*.*prisma*.*invites*.groupBy*({
by: ["inviterId"],
_count: {
inviterId: *true*,
},
orderBy: {
_count: {
inviterId: 'desc',
},
where: {
serverId: message*.*guildID,
valid: *true*,
},
},
});
Hi, I'm not sure if someone could help me. But I'm currently trying to order this by highest to lowest numbers. But im getting an error which im not sure how to get by.
Type '{ _count: { inviterId: string; }; where: { serverId: string | undefined; valid: true; }; }' is not assignable to type 'Enumerable<invitesOrderByInput> | undefined'.
Object literal may only specify known properties, and '_count' does not exist in type 'Enumerable<invitesOrderByInput>'Richard Ward
06/01/2021, 9:43 PMRichard Ward
06/01/2021, 9:43 PMorderByAggregateGroup is only available in 2.21.0 and upLogan
06/01/2021, 9:43 PMRichard Ward
06/01/2021, 9:43 PMLogan
06/01/2021, 9:44 PMRichard Ward
06/01/2021, 9:44 PMRichard Ward
06/01/2021, 9:45 PMresult = await client.prisma.invites.groupBy({
by: ["inviterId"],
_count: {
inviterId: true,
},
orderBy: {
_count: {
inviterId: 'desc',
},
},
where: {
serverId: message.guildID,
valid: true,
},
});Richard Ward
06/01/2021, 9:45 PMLogan
06/01/2021, 9:46 PMType '{ _count: { inviterId: string; }; }' is not assignable to type 'Enumerable<invitesOrderByInput> | undefined'.
Object literal may only specify known properties, and '_count' does not exist in type 'Enumerable<invitesOrderByInput>Richard Ward
06/01/2021, 9:47 PMpreviewFeatures = ["orderByAggregateGroup"] set in your schema.prisma file?Logan
06/01/2021, 9:47 PMRichard Ward
06/01/2021, 9:48 PMRichard Ward
06/01/2021, 9:48 PMLogan
06/01/2021, 9:51 PMLogan
06/01/2021, 9:51 PMgenerator client {
provider = "prisma-client-js"
previewFeatures = ["orderByAggregateGroup"]
}Richard Ward
06/01/2021, 9:51 PMRichard Ward
06/01/2021, 9:52 PMprisma generateRichard Ward
06/01/2021, 9:52 PMLogan
06/01/2021, 9:53 PMRichard Ward
06/01/2021, 9:54 PMLogan
06/01/2021, 9:54 PM