Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

prisma multiple relation counts

const usersWithCount = await prisma.user.findMany({
  select: {
    _count: {
      select: {
        posts: true,
        recipes: true,
      },
    },
  },
})
Source by www.prisma.io #
 
PREVIOUS NEXT
Tagged: #prisma #multiple #relation #counts
ADD COMMENT
Topic
Name
1+5 =