Hello... Im new to prisma. Just getting started today. Now I just read the docs about include specially in one to many advantage. But im curious if I have the user and post relationship does user will return all the posts made by the user??
how will I do the first 5 posts only?
r
Ryan
06/22/2021, 6:21 AM
@ian 👋
You can use
take
inside
include
like this:
Copy code
include: { posts: { take: 5 } }
👍 1
i
Ian
06/22/2021, 12:57 PM
thanks @Ryan still studying the prisma syntax..
🙌 1
Ian
06/22/2021, 12:59 PM
by any chance.. would you count the post of the user?? lets say its a twitter app.. would you count via prisma or will you save postCount in db?