> ## 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

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

The Instagram plugin syncs data locally. Use `corsair.instagram.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>

## Comments

Path: `instagram.db.comments.search`

```ts theme={null}
const rows = await corsair.instagram.db.comments.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 |
| `text`      | `string` | equals, contains, startsWith, endsWith, in |
| `timestamp` | `string` | equals, contains, startsWith, endsWith, in |
| `username`  | `string` | equals, contains, startsWith, endsWith, in |

*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).*

***

## Conversations

Path: `instagram.db.conversations.search`

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

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `conversationId` | `string` | equals, contains, startsWith, endsWith, in |
| `pageId`         | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`      | `string` | equals, contains, startsWith, endsWith, in |

*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).*

***

## Media

Path: `instagram.db.media.search`

```ts theme={null}
const rows = await corsair.instagram.db.media.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 |
| `username`  | `string` | equals, contains, startsWith, endsWith, in |
| `media_url` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt` | `date`   | equals, before, after, between             |
| `caption`   | `string` | equals, contains, startsWith, endsWith, in |

*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: `instagram.db.messages.search`

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

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `messageId`      | `string` | equals, contains, startsWith, endsWith, in |
| `conversationId` | `string` | equals, contains, startsWith, endsWith, in |
| `senderId`       | `string` | equals, contains, startsWith, endsWith, in |
| `recipient`      | `string` | equals, contains, startsWith, endsWith, in |
| `senderName`     | `string` | equals, contains, startsWith, endsWith, in |
| `message`        | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`      | `string` | equals, contains, startsWith, endsWith, in |
| `updatedAt`      | `string` | equals, contains, startsWith, endsWith, in |

*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).*

***

## Users

Path: `instagram.db.users.search`

```ts theme={null}
const rows = await corsair.instagram.db.users.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 |
| `ig_id`               | `number` | equals, gt, gte, lt, lte, in               |
| `username`            | `string` | equals, contains, startsWith, endsWith, in |
| `name`                | `string` | equals, contains, startsWith, endsWith, in |
| `biography`           | `string` | equals, contains, startsWith, endsWith, in |
| `profile_picture_url` | `string` | equals, contains, startsWith, endsWith, in |
| `followers_count`     | `number` | equals, gt, gte, lt, lte, in               |
| `follows_count`       | `number` | equals, gt, gte, lt, lte, in               |
| `media_count`         | `number` | equals, gt, gte, lt, lte, in               |
| `website`             | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`           | `date`   | equals, before, after, between             |
| `updatedAt`           | `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).*

***
