String Matching

Use contains, startsWith, and endsWith to filter string fields based on partial matches.

String Matching Operators

Prisma PHP provides three powerful operators for filtering string-based fields:

  • contains — Matches records where the field contains the given substring.
  • startsWith — Matches records where the field begins with the given prefix.
  • endsWith — Matches records where the field ends with the specified suffix.

These filters can be combined to perform complex text-matching queries.

Example Usage

$users = $prisma->user->findMany([
    'where' => [
        'name' => [
            'contains' => 'Rey',
            'startsWith' => 'R',
            'endsWith'   => 'o'
        ]
    ]
]);