NestJS - Database with Prisma
Given the following Prisma models:
What will
model User {
id Int @id @default(autoincrement())
name String
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
title String
userId Int
user User @relation(fields: [userId], references: [id])
}What will
prisma.user.findUnique({ where: { id: 1 }, include: { posts: true } }) return if the user with id = 1 has no posts?