```if (testUser.roles.includes('ADMIN')) { r...
# orm-help
a
Copy code
if (testUser.roles.includes('ADMIN')) {
      return prisma.user.findMany({
        take,
        skip,
        include: { posts: true },
        where: { roles: 'USER' },
      });
    }
How can I filter
roles
property in where selector. [roles is an array]
s
I think the way you have structured it is a bit redundant because assuming each
User
has an assigned role, you can just use the
findMany
method and filter for all the users who have the role
ADMIN
. How have you structured your
User
model?