# Main tab

![](/files/TgzVdotPpInx7CfCtUUr)

Use this tab to specify the connection string and command execution properties.

## Connection

To specify your connection, use the following:

| Option           | Description                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| String           | Enter a MongoDBconnection string URI. Both `mongodb://` and `mongodb+srv://` schemes are supported. his option supports variable substitution, and it can contain the output of the `Encr.bat/encr.sh` command. For more information on URI construction, please see MongoDB's [Connection String URI Format](https://docs.mongodb.com/manual/reference/connection-string/) information. |
| Test and Get DBs | Click to test the connection string and get the databases you are authorized to access.                                                                                                                                                                                                                                                                                                  |
| Database         | Select from the list of databases on which you want ot perform the commands.                                                                                                                                                                                                                                                                                                             |

## Command(s) source

There are a few options to run commands.

Select the **Script** option when you want to run static commands.

![](/files/RzBSwUgKRUTvLLl5cPBK)

| Option                         | Description                                                                                                                                                                                                         |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Script                         | Enter the commands you want to execute in the text box. You can use multiple commands by separating them with semi-colons.                                                                                          |
| Execute for every row of input | Select this option to execute the command for each incoming row for the step. When selected, a question mark(?) wild card field substitution can be used to modify the commands that will be invoked with row data. |

Select the \*\*Field\*\* option when the run commands are specified on an incoming field.

![](/files/KuTNnFtGnYLcQx0xN6GI)

| Option                     | Description                                                                   |
| -------------------------- | ----------------------------------------------------------------------------- |
| Name                       | The name of an incoming field that contains one or more commands to execute.  |
| Perform ? value substition | Select this option to perform a field name substitution before the step runs. |


---

# Agent Instructions: 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-execute/options-mongodb-execute/main-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.
