> For the complete documentation index, see [llms.txt](https://ra-libs.gitbook.io/nestjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ra-libs.gitbook.io/nestjs/utils/withfilterfield.md).

# withFilterField

withFilterField method adds a new filter field (key/value) to the prisma query.

### Usage

```typescript
import { withFilterField } from '@ra-libs/nestjs';

query = withFilterField(query, 'firstName', 'John')
```

the query value will be

```typescript
{
    ...query,
    where: {
        ...
        OR: [
            ...,
            {
                firstName: {
                    contains: 'John',
                    mode: 'insensitive'
                }
            }
        ]
    }
}
```
