mazhar iqbal
10/16/2022, 4:32 PMNurul
10/17/2022, 6:29 AMconst response = await prisma.user.findMany({
where: {
OR: [
{
name: 'John',
},
{
posts: {
some: {
title: 'First Post',
},
},
},
],
},
include: {
posts: true,
},
});
Sample Response:
[
{
"id":1,
"email":"<mailto:test@prisma.io|test@prisma.io>",
"name":"Test",
"posts":[
{
"id":1,
"title":"First Post",
"published":false,
"authorId":1
}
]
},
{
"id":2,
"email":"<mailto:john@prisma.io|john@prisma.io>",
"name":"John",
"posts":[]
}
]
mazhar iqbal
10/17/2022, 9:02 AM