Output
MongoDB Output
Writes the rows as documents to a MongoDB collection: insert, replace the collection, or upsert by key columns.
When to use it
Use it to keep a collection of profiles or reference data in step with a cleaned source.
In a pipeline
File InputMongoDB Output
Settings
| Setting | Type | Required | Default or hint |
|---|---|---|---|
| Connection | select | Yes | Add a connection below |
| Target Table | select | Yes | Select a table |
| Write Mode | select | — | append |
| Key columns | select | — | Columns that identify a row |
Example
Upsert profiles
- Target Table=customers
- Write Mode=Upsert (update rows whose key exists)
- Key columns=email
| name | |
|---|---|
| ann@example.com | Ann Lee |
| name | |
|---|---|
| ann@example.com | Ann Lee |
Worth knowing
- Each row becomes one document; columns become fields, and text holding JSON goes back as a sub-document.
- Upsert replaces the document whose key fields match (replaceOne with upsert).
- Under a Transaction Control the writes run in a MongoDB transaction, which needs a replica set — Atlas is one.