Export MongoDB
Description
Section titled “Description”Writes each row of a project table to a MongoDB collection as a document. The collection is created when it doesn’t exist. The step reaches MongoDB through a MongoDB connection.
Source and Target
Section titled “Source and Target”| Setting | Required | What it does |
|---|---|---|
| Source Table | Yes | The table to write. |
| MongoDB Connection | Yes | The connection to write through. |
| Database | No | The database to write. Leave it blank to use the connection’s Default Database. |
| Collection | Yes | The collection to write. |
Write Options
Section titled “Write Options”| Setting | What it does |
|---|---|
| Write Mode | Insert a Document per Row (the default), Replace the Matching Document, Update Fields of the Matching Document, Replace the Matching Document, or Insert, or Update Fields of the Matching Document, or Insert. |
| Match Columns | The comma-separated columns that identify a document. Required for every mode but insert. |
| Delete every document in the collection before writing | Empties the collection first, so it holds only this run’s rows. |
| Stop at the first failed write | Stops at the first document MongoDB refuses. Clear it to carry on with the rest. |
| Wait for the write to reach the journal | Waits until MongoDB has written each batch to its journal. |
| Write Concern | Blank for the connection’s, a number of servers, or majority. |
| Documents per Request | How many documents are sent in each request. |
Insert adds the documents again each time the step runs. The modes that replace or update leave the collection the same however many times the step runs, so use one of them when a workflow may run twice over the same rows.
When the Source Is Missing or Empty
Section titled “When the Source Is Missing or Empty”The step doesn’t fail when there is nothing to write. It succeeds and logs a warning that names the collection or table:
- The source table doesn’t exist. The warning is
No table found for path "…", so nothing was written to collection …, and the collection is left as it was, even when Delete every document in the collection before writing is on. - The source table has no columns. With no source or target columns mapped, the step writes every column the table has, so this applies to a table with none. The warning is
Table … has no columns; nothing was written to collection …. - The source table has no rows. The warning is
The table has no rows; nothing was written to …. With Delete every document in the collection before writing on, the collection is emptied and the warning says so:… was emptied and nothing was written to it.