MongoDB Execute
The MongoDB Execute step connects to a MongoDB cluster and executes Mongo shell-style commands.
Commands can:
Be statically defined.
Use placeholders that are substituted with values from incoming rows.
Be provided from a field in incoming rows.
Supported security providers
This step supports the following MongoDB server security providers:
SCRAM-SHA-1 / SCRAM-SHA-256
LDAP
Kerberos
X509
Step name
Step name specifies the unique name of the step on the canvas. You can change it.
Configure the step (tabs)
Configure connection tab
Use this tab to specify the connection string and command source.

Connection
String
MongoDB connection string URI. Both mongodb:// and mongodb+srv:// schemes are supported. This field supports variable substitution and can contain output from encr.bat / encr.sh. For URI construction, see MongoDB’s Connection String URI Format.
Test and Get DBs
Tests the connection string and lists databases you are authorized to access.
Database
Database to run commands against.
Command(s) source
You can provide commands in one of the following ways:
Script: run static commands.
Field: run commands stored in an incoming field.
Script option
Use the script area to enter one or more commands. Separate multiple commands with semicolons (;).

Execute for every row of input
Executes the command(s) once per incoming row. When selected, you can use placeholder substitution to incorporate values from the incoming row into the command.
Field option
Use this option when commands are provided in an incoming field.

Name
Name of the incoming field that contains one or more commands to execute.
Perform ? value substitution
Performs field-value substitution before the step runs.
Configure step tab
Use this tab to control step behavior.

Result field name
Adds a String field to the output stream containing the result information for each command executed. If multiple commands are executed, the step outputs a row of results for each command.
Command field name
Adds a String field containing the command associated with each result row. This helps downstream steps interpret results when multiple commands are executed. Leave blank to omit this field.
Stop on error
Stops the transformation when an error occurs. If not selected, errors are sent to the step’s error-handling stream.
Command reference
Commands generally follow MongoDB shell syntax. Arguments may be:
STRING(double or single quotes)BSON(less restrictive JSON)[ BSON, ... ]
Example
Metadata injection support
All fields of this step support metadata injection. You can use it with ETL metadata injection to pass metadata to your transformation at runtime.
Last updated
Was this helpful?

