Hei
11/21/2021, 8:20 AMconst countTags = await ctx.prisma.tag.findMany({
select: {
name: true,
_count: {
select: {
questions: true,
},
},
},
});
Since its implicit I cannot call the third table to query it directly.
Here's my schema:
model Question {
id Int @id @default(autoincrement())
title String
content String
tags Tag[]
}
model Tag {
id Int @id @default(autoincrement())
name String @unique
questions Question[]
}
Ryan
11/22/2021, 5:35 AMHei
11/22/2021, 5:37 AM