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

# MongoDB

## Basic config

```yaml theme={"system"}
connection_string: "mongodb://mongodb_container_name:27017/"
database_name: database_name
collection_name: collection_name
```

* `connection_string`: URI defines connection between application and MongoDB instance.
* `database_name`: The database where you want to store the data.
* `collection_name`: The collection where you want to group the documents.

## Optional fields

```yaml theme={"system"}
unique_constraints: ['col1', 'col2']    # Upsert documents based on unique constraints
```
