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

# Database

> Zoho Mail local sync: searchable entities, `.search()` filters, and operators.

The Zoho Mail plugin syncs data locally. Use `corsair.zohomail.db.<entity>.search({ data, limit?, offset? })` with the filters listed per entity.

<Info>
  **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy).
</Info>

## Folders

Path: `zohomail.db.folders.search`

```ts theme={null}
const rows = await corsair.zohomail.db.folders.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `id`             | `string` | equals, contains, startsWith, endsWith, in |
| `folderId`       | `string` | equals, contains, startsWith, endsWith, in |
| `folderName`     | `string` | equals, contains, startsWith, endsWith, in |
| `path`           | `string` | equals, contains, startsWith, endsWith, in |
| `parentFolderId` | `string` | equals, contains, startsWith, endsWith, in |
| `folderType`     | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`      | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Messages

Path: `zohomail.db.messages.search`

```ts theme={null}
const rows = await corsair.zohomail.db.messages.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field           | Type     | Operators                                  |
| --------------- | -------- | ------------------------------------------ |
| `entity_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `id`            | `string` | equals, contains, startsWith, endsWith, in |
| `messageId`     | `string` | equals, contains, startsWith, endsWith, in |
| `threadId`      | `string` | equals, contains, startsWith, endsWith, in |
| `folderId`      | `string` | equals, contains, startsWith, endsWith, in |
| `subject`       | `string` | equals, contains, startsWith, endsWith, in |
| `summary`       | `string` | equals, contains, startsWith, endsWith, in |
| `fromAddress`   | `string` | equals, contains, startsWith, endsWith, in |
| `toAddress`     | `string` | equals, contains, startsWith, endsWith, in |
| `ccAddress`     | `string` | equals, contains, startsWith, endsWith, in |
| `sender`        | `string` | equals, contains, startsWith, endsWith, in |
| `sentDateInGMT` | `string` | equals, contains, startsWith, endsWith, in |
| `receivedTime`  | `string` | equals, contains, startsWith, endsWith, in |
| `size`          | `string` | equals, contains, startsWith, endsWith, in |
| `hasAttachment` | `string` | equals, contains, startsWith, endsWith, in |
| `status`        | `string` | equals, contains, startsWith, endsWith, in |
| `flagid`        | `string` | equals, contains, startsWith, endsWith, in |
| `priority`      | `string` | equals, contains, startsWith, endsWith, in |
| `content`       | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`     | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***
