> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# MongoDB

Supports:
* ✅ Models
* ✅ Model sync destination
* ✅ Bulk sync source




## Connection

### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>change_detection</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Use change stream for bulk syncs</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>database</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Auth database</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>hosts</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Hostname(s)</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>params</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Additional parameters<br/><br/>Additional connection parameters, formatted as a query string</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>password</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Password</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>srv</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Connect using SRV record?</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>ssl</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Use TLS/SSL</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>username</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Username</td>
<td><code>false</code></td>
</tr>
</tbody>
</table>


#### Example

```json
{
  "name": "MongoDB connection",
  "type": "mongodb",
  "configuration": {
    "change_detection": false,
    "database": "",
    "hosts": "mongodb.example.net",
    "params": "",
    "password": "password",
    "srv": false,
    "ssl": false,
    "username": "admin"
  }
}
```

## Model Sync
### Source
#### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>aggregation</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;"></td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>collection</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Collection</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>database</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Database</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>query</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;"></td>
<td><code>false</code></td>
</tr>
</tbody>
</table>


#### Example
```json
{
  ...
  "configuration": {
    "aggregation": "",
    "collection": "users",
    "database": "public",
    "query": "db.users.find({\"name.family\": \"Smith\"})"
  }
}
```

### Target
MongoDB connections may be used as the destination in a model sync.




### Target creation

MongoDB connections may be used to create a new target for a model sync. The
following parameters are required to create a new target:

<table>
<thead>
<tr>
  <th>NAME</th>
  <th>DESCRIPTION</th>
  <th>ENUM</th>
</tr></thead>
<tbody>
<tr>
  <td>name</td>
  <td>Collection name</td>
  <td>false</td>
</tr>

</tbody>
</table>




## Bulk Sync
### Source
MongoDB connections may be used as a bulk sync source. No additional configuration options are required.