nick
08/14/2022, 9:51 PMinclude: { posts: true}
on a user query but I only want the first post in the returned posts array, any way to do this?nikolasburk
take
argument inside of include
. Here’s an example:
await prisma.user.findMany({
include: {
posts: {
take: 1
}
}
})
Riandharu Prastantyo
08/27/2022, 6:23 PM