How to configure MongoDB as a destination in Mage to write data to a MongoDB database using a connection string.
Key | Description | Example Value | Required |
---|---|---|---|
connection_string | MongoDB connection URI string, including hostname and port. | mongodb://mongodb0.example.com:27017 | ✅ |
db_name | Name of the MongoDB database where documents will be stored. | admin | ✅ |
table_name | (Optional) Name of the MongoDB collection to write to. If omitted, the stream name is used. | user_profiles | ❌ |
connection_string
should include any authentication, cluster details, or replica set info as needed (e.g., mongodb+srv://user:pass@cluster0.mongodb.net/
).table_name
is not set, Mage automatically uses the name of the stream that produced the data.