> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usehasp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filtering

> Filter DSL reference for listRecords and paginateRecords — operators, examples, and OR logic.

Filters are passed as an object to `listRecords` and `paginateRecords`. Multiple fields use AND logic — all conditions must match.

## Syntax

```javascript theme={null}
{ fieldKey: { operator: value } }
```

## Operators

| Operator   | Description                        | Example                                       |
| ---------- | ---------------------------------- | --------------------------------------------- |
| `eq`       | Equal                              | `{ status: { eq: 'open' } }`                  |
| `neq`      | Not equal                          | `{ status: { neq: 'done' } }`                 |
| `in`       | In array                           | `{ status: { in: ['open', 'in_progress'] } }` |
| `contains` | String contains (case-insensitive) | `{ title: { contains: 'milk' } }`             |
| `gt`       | Greater than                       | `{ priority: { gt: 3 } }`                     |
| `gte`      | Greater than or equal              | `{ due_date: { gte: '2026-03-01' } }`         |
| `lt`       | Less than                          | `{ priority: { lt: 5 } }`                     |
| `lte`      | Less than or equal                 | `{ due_date: { lte: '2026-03-31' } }`         |

<Note>Filtering on a field key that does not exist in the entity schema returns an empty result set — no error is thrown.</Note>

## Examples

```javascript theme={null}
// Exact match
{ status: { eq: 'open' } }

// Multiple status values
{ status: { in: ['open', 'in_progress'] } }

// Text search (case-insensitive)
{ title: { contains: 'search term' } }

// Boolean field
{ is_complete: { eq: true } }

// Date range — a single field can have multiple operators
{ due_date: { gte: '2026-03-01', lte: '2026-03-31' } }

// Multiple fields (AND logic)
{ status: { eq: 'open' }, due_date: { lte: '2026-03-31' } }
```

## multi\_select Fields

Use `contains` to filter records where a multi-select field includes a specific value:

```javascript theme={null}
// Records tagged as 'vendor'
{ tags: { contains: 'vendor' } }
```

## No Client-Side Filtering

Always use the filter DSL instead of fetching all records and filtering in JavaScript. Filtering server-side is dramatically more efficient and doesn't break pagination.

## OR Logic

OR logic across fields is not currently supported — all conditions use AND. If you need OR behaviour (e.g. "status is open OR assignee is me"), make two separate requests and merge the results in your app. Deduplicate by `id` before rendering to handle any records that appear in both result sets.
