AND Operator
The AND operator requires all provided conditions to be true for a record to match.
Purpose
The AND operator allows you to combine multiple
filtering rules. A record will be returned only if every condition is satisfied.
AND can be used implicitly or explicitly.
Implicit AND
$users = $prisma->user->findMany([
'where' => [
'roleId' => 2,
'status' => 'active'
]
]);
Explicit AND
$users = $prisma->user->findMany([
'where' => [
'AND' => [
['email' => ['contains' => 'gmail.com']],
['isActive' => true]
]
]
]);