# tCosmosDBSQLAPIOutput Standard properties

Availability-note[subscription](https://help.talend.com/r/en-US/Cloud/labels-on-talend-help-center/availability-subscription)

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

The Standard tCosmosDBSQLAPIOutput component belongs to the Databases NoSQL family.

The component in this framework is available in subscription-based Talend products.

Information noteNote: This component is available only if you have installed the R2020-06 Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

## Basic settings

| Property type | Either Built-in or Repository.<br><br><ul> <li> <span>Built-in</span>: No property data is stored                      centrally.</li> <li> <span>Repository</span>: Select the repository file                        in which the properties are stored. The fields that follow are completed                        automatically using the data retrieved.</li> </ul> |
| --- | --- |
| Schema and Edit schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<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<br>schema to make changes to the schema.<br><br>Information noteNote: If you<br>make changes, the schema automatically becomes built-in.<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion. If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> |
| URI | Enter the URI of your Cosmos user account. As the field prompts, the URI of a<br>Cosmos DB user account is in the format of https://{your\_account}.document.azure.com:443. You can obtain the URI<br>on the Keys pane of Azure portal. Click [Create an Azure Cosmos DB account](https://docs.microsoft.com/en-us/azure/cosmos-db/create-cosmosdb-resources-portal) for<br>related information. |
| Primary key | Enter the primary key of your CosmosDB user account. You can obtain<br>the pimary key on the Keys pane of Azure<br>portal. Click [Create an Azure Cosmos DB account](https://docs.microsoft.com/en-us/azure/cosmos-db/create-cosmosdb-resources-portal) for<br>related information. |
| Database ID | Enter the the database name. |
| Collection ID | Enter the collection name. |
| Create collection if not exist | Select this option to have the collection specified in the Collection ID<br>field created if it does not exist. This option is not available if<br>Update or Delete is selected from the<br>Data action drop-down list. |
| Data action | Select one of the following options.<br><br><ul> <li> <p> <span>Insert</span>: inserts documents.</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</span>: inserts a document if it does not exist              otherwise it applies the same rules as <span>Update</span>.</p> </li> <li> <p> <span>Delete</span>: deletes documents.</p> </li> </ul> |
| Auto ID generation | Select this option to generate IDs for the documents processed. |

## Advanced settings

| tStatCatcher Statistics | Select this check box to collect the log data at the component<br>level. |
| --- | --- |
| Connection mode | Specify the connection mode to be used. Two options are available: Gateway and DirectHttps. Click [ConnectionMode](https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.cosmosdb.connectionmode?view=azure-java-legacy) for related information. |
| Max connection pool size | Set the maximum connection pool size. The default is 1000. |
| Consistency level | Set the consistency level. Click [Consistency levels](https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels) for related<br>information. |
| Partition key | Enter the key of the partition whose documents will be removed. This option is available when Delete is selected from the Data action drop-down list. |

## Global Variables

| 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 rule** | tCosmosDBSQLAPIOutput executes<br>the action defined on the collection in the database based on the flow<br>incoming from the preceding component in the Job. |
| --- | --- |