NestJS - Database with Prisma
You want to fetch all
Order records with their related Customer data, but only include customers who have placed more than 5 orders. Which Prisma query approach correctly applies this filter using relations?model Customer {
id Int @id @default(autoincrement())
name String
orders Order[]
}
model Order {
id Int @id @default(autoincrement())
total Float
customerId Int
customer Customer @relation(fields: [customerId], references: [id])
}