> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/mongodb-output/options-mongodb-output/output-options-tab.md).

# Output options tab

![MongoDB Output Output options tab](/files/cuYJgnLztTawvAHltIkJ)

The **Output options** tabprovides additional controls for inserting data into a MongoDB collection. If the specified collection does not exist, it is created before a document is inserted.

Enter the following information in the transformation step fields:

| Option                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Database**                                  | Specify the target database for the output. When a valid hostname and port has been set, you can click **Get DBs** to retrieve the names of existing databases within a selected database.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Collection**                                | Specify the target collection for the output. When a valid hostname and port has been set, you can click **Get Collections** to retrieve the names of existing collections within a selected database. If the specified collection does not exist, it will be created before data is inserted.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Batch insert size**                         | Specify the batch size for bulk insert operations. The default value is 100 rows.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Truncate collection**                       | Select to delete existing data in the target collection before inserting new data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Update**                                    | <p>Sets the update write method for the specified database and collection.</p><p>The <strong>Upsert</strong> and <strong>Modifier update</strong>options are not available unless the <strong>Update field</strong> is selected.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Upsert**                                    | Select to change the write method from insert to upsert. The upsert method replaces a matched record with an entire new record based on all the incoming fields specified in the **Mongo document fields tab**. A new record is created if match conditions fail for an update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Multi-update**                              | Select to update all matching documents for each update or upsert operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Modifier update**                           | <p>Select to enable modifiers (<code>$</code> operators) to be used to modify individual fields within matching documents. All matching documents are updated when the <strong>Multi-update</strong> option is selected.</p><p>To update more than one matching document, select <strong>Modifier update</strong>and <strong>Upsert</strong>. Selecting <strong>Modifier update</strong>, <strong>Upsert</strong>, and <strong>Multi-update</strong> applies updates to all matching documents, instead of just the first.</p>                                                                                                                                                                                                                        |
| **Number of retries for write operations**    | Specify the number of times that a write operation is attempted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Delay, in seconds, between retry attempts** | Specify the number of seconds to wait before the next retry.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Write concern (w option)**                  | <p>Specify the minimum number of servers that must succeed for a write operation. The values are:</p><ul><li><strong>-1</strong></li></ul><p>Disables all acknowledgement of write operation errors</p><ul><li><strong>0 (Zero)</strong></li></ul><p>Disables basic acknowledgment of write operations, but returns information about socket excepts and networking errors</p><ul><li><strong>1</strong></li></ul><p>Acknowledges write operations on the primary node</p><ul><li><strong>>1</strong></li></ul><p>Wait for successful write operations to the specified number of slaves, including the primary.</p><p>Click <strong>Get custom write concerns</strong> to retrieve custom write concerns that you have stored in the repository.</p> |
| **w Timeout**                                 | Specify time (in milliseconds) to wait for a response to write operations before terminating the operation. Leave blank to never terminate.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Journaled writes**                          | Select to set write operations to wait until the mongod (the primary daemon process for the MongoDB system) acknowledges the write operation and commits the data to the journal.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Read preference**                           | <p>Specify which node to read first</p><ul><li><code>Primary</code></li><li><code>Primary preferred</code></li><li><code>Secondary</code></li><li><code>Secondary preferred</code></li><li><code>Nearest</code></li></ul><p>The default is Primary.</p><p>The <strong>Read preference</strong> is available when <strong>Modifier update</strong> is selected.</p>                                                                                                                                                                                                                                                                                                                                                                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/mongodb-output/options-mongodb-output/output-options-tab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
