# tAmazonDocumentDBOutput

Executes the action defined on the collection in the Amazon DocumentDB database.

tAmazonDocumentDBOutput inserts, updates, upserts or deletes documents in an Amazon DocumentDB database collection based on the incoming flow from the preceding component in the Job.

This component is not shipped with your Talend Studio by default. You need to install it using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

## tAmazonDocumentDBOutput Standard properties

These properties are used to configure tAmazonDocumentDBOutput running in the Standard Job framework.

The Standard tAmazonDocumentDBOutput component belongs to the Cloud family.

Talend Studio is compatible with Amazon DocumentDB 3.6 version.

The component in this framework is available in all Talend products with Big Data and in Talend Data Fabric.

Information noteNote: This component is available only when you have installed the 8.0.1-R2022-02 Talend Studio Monthly update or a later one delivered by Talend.

## Basic settings

| Properties | Description |
| --- | --- |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                                locally for this component. You need to specify the values for all                                related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                                centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component. </p> <p>You need to click                                the <span>[...]</span> button next to it and in the pop-up                                    <span>Repository Content</span> dialog box, select the                                connection details to be reused, and all related connection                                properties will be automatically filled in.</p> </li> </ul> |
| Use an existing connection | Select this check box and in the Component<br>List drop-down list, select the desired connection component to<br>reuse the connection details you already defined. |
| Schema and Edit Schema | A schema is a row description, and it defines the fields to be processed and<br>passed on to the next component.<br><br><ul> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> </li> </ul><br><br>Click Edit schema to make changes to<br>the schema. If you make changes, the schema automatically becomes built-in. |
| Address type | Select the address type from the drop-down list:<br><br><ul> <li> <span>Standalone</span>: define the standalone Amazon DocumentDB                        database server you want to connect to.</li> <li> <span>Replica set</span>: define a set of multiple Amazon                        DocumentDB database servers you want to connect to in the                           <span>ReplicaSet address</span> table.</li> </ul> |
| Host and Port | Enter the IP address and listening port of the database server.<br><br>These fields are available when the Use existing connection or Use<br>replica set address check box are not selected.<br><br>These<br>parameters are only available when you select the<br>Standalone from the Address<br>type drop-down list. |
| Database | Enter the name of the Amazon DocumentDB database.<br><br>This parameter is only<br>available when you select the Standalone from the<br>Address type drop-down list. |
| Need auth | Select this check box to enable the database authentication.<br><br>Among the mechanisms listed on the Auth mechanism<br>drop-down list, select either Negotiate,<br>which is recommended because it automatically select the most adapted<br>authentication mechanism, or SCRAM-SHA-1 SASL, or<br>SCRAM-SHA-256.<br><br>Select the Use auth<br>database check box to enter the name of the authentication<br>database in which the username to be used to connect to Amazon DocumentDB has<br>been created and enter the database user authentication data in the<br>Username and Password<br>fields.<br><br>To enter the password, click the [...] button<br>next to the Password field to bring out the Enter a new<br>password dialog box, enter the password in the text field, and click<br>OK. Note that you can enter the password either in a JSON string<br>in the pure password mode or as a Java expression in the Java<br>mode. You can toggle between the two modes by clicking switch to<br>Java mode or switch to pure password mode on the top<br>of the text field.<br><br>Information noteNote:<br><br><ul> <li>The two password modes are available only when you have installed the                  8.0.1-R2022-05 <span>Talend Studio</span>                  monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> <li>If the 8.0.1-R2022-05 <span>Talend Studio</span>                  monthly update or a later one delivered by <span>Talend</span>                  is not installed, you can enter passwords in the <span>Java mode</span>                  only. </li> </ul> |
| Use SSL connection | Select this checkbox to enable the SSL or TLS encrypted connection.<br><br>Then you need to use the tSetKeystore<br>component in the same Job to specify the encryption information. |
| Collection | Enter the name of the collection in the Amazon DocumentDB<br>database. |
| Use query | Select this check box to retrieve data using query statements. You can enter<br>the query statement in the Query field. |
| Mode | Select the type of target data to write between<br>JSON and Text. |
| Set write concern | Select this check box to set the level of acknowledgment requested for write<br>operations from the Write concern drop-down list. |
| Bulk write | Select this check box to insert, update, or remove data in bulk. |
| Data action | The following operations are available:<br><br><ul> <li> <p> <span>Insert</span>: insert documents.</p> </li> <li> <p> <span>Set</span>: modifies the existing fields of an existing                document and appends a field if it does not exist in this document. </p> <p>If you need to apply this action on all the documents in the collection to be                used, select the <span>Update all document</span> check box that                is displayed; otherwise, only the first document is updated.</p> </li> <li> <p> <span>Update</span>: replaces the existing documents with the                incoming data but keeps the technical ID of these documents.</p> </li> <li> <p> <span>Upsert with set</span>: inserts a document if it does                not exist otherwise it applies the same rules as <span>Set</span> </p> <p>If you need to apply this action on all the documents in the collection to be                used, select the <span>Update all document</span> check box that                is displayed; otherwise, only the first document is updated.</p> </li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStatCatcher Statistics | Select this check box to collect the log data at the component<br>level. |
| Max batch size | Set the maximum number of lines allowed in each batch.<br><br>Do not change the<br>default value unless you are facing performance issues. Increasing the batch<br>size can improve the performance but a value too high could cause Job<br>failures. |
| Connection parameter | Specify additional connection properties for the Amazon DocumentDB<br>connection you are creating. |

## Global Variables

| Variables | Description |
| --- | --- |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |
| NB\_LINE | The number of rows processed. This is an After variable and<br>it returns an integer. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | tAmazonDocumentDBOutput executes<br>the action defined on the collection in the Amazon DocumentDB database<br>based on the flow incoming from the preceding component in the Job. |