- If using Matillion Full SaaS: The component will use the cloud credentials associated with your environment to access resources.
- If using Hybrid SaaS: By default the component will inherit the agent’s execution role (service account role). However, if there are cloud credentials associated with your environment, these will overwrite the role.
Properties
Reference material is provided below for the Connect, Configure, Destination, and Advanced Settings properties.string
required
A human-readable name for the component.
Connect
integer
Specify a MongoDB connection port number. The default, 27017, is used if this is left blank.
string
A valid MongoDB username.
drop-down
Choose the secret definition that represents your credentials for this connector.If you have not already saved your credentials for this connector as a secret definition, click Add secret to create a secret definition representing these credentials. Read Secrets and secret definitions for details about creating a secret definition.
string
required
The server IP or DNS address of the MongoDB server endpoint. For example,
{cluster-name}.cluster-xxxxxxxxxxxx.{region}.docdb.amazonaws.com.string
required
The name of the MongoDB server’s database.
boolean
required
- Yes: Nested document structures are flattened into a set of fields. Determining which fields are available can become expensive in this mode, since more data needs to be scanned to determine which fields are available.
- No: Nested document structures are returned as JSON strings. They can be further queried/manipulated by JSON functions in a transformation pipeline after being staged.
integer
Set the maximum number of elements that any array can be flattened to. Flattened arrays have each element placed into its own respective (newly created) column.
- Entering 0 for this property will ensure all arrays remain in JSON string format.
- Entering -1 for this property will ensure all elements from arrays are flattened.
- Requesting to flatten more elements than exist in an array will result in all elements of that array being flattened.
- Determining which fields are available can become expensive in this mode, since more data needs to be scanned to determine which fields are available.
Connection Options = column editor
- Parameter: A JDBC parameter supported by the database driver. The available parameters are explained in the data model. Manual setup is not usually required, since sensible defaults are assumed.
- Value: A value for the given parameter.
Configure
drop-down
required
- Basic: This mode will build a query for you using settings from the Data Source, Data Selection, Data Source Filter, Combine Filters, and Limit parameters. In most cases, this mode will be sufficient.
- Advanced: This mode will require you to write an SQL-like query to call data from the service you’re connecting to. The available fields and their descriptions are documented in the data model.
code editor
required
Enter an SQL-like SELECT query to retrieve the data you want. This query must be written in the SQL accepted by your cloud data warehouse. Treat collections as table names, and fields as columns. Only available in Advanced mode.For more information, read the SELECT query documentation for your cloud data warehouse:
drop-down
required
Select a single data source to be extracted from the source system and loaded into a table in the destination. The source system defines the data sources available. Use multiple components to load multiple data sources.
object selector
required
Select the columns to fetch from the selected data source. Only available in Basic mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
Define one or more filter conditions that each row of data must meet to be included in the load.
- Input Column: Select an input column. The available input columns vary depending upon the data source.
- Qualifier:
- Is: Compares the column to the value using the comparator.
- Not: Reverses the effect of the comparison, so “Equals” becomes “Not equals”, “Less than” becomes “Greater than or equal to”, etc.
- Comparator: Choose a method of comparing the column to the value. Possible comparators include: “Equal to”, “Greater than”, “Less than”, “Greater than or equal to”, “Less than or equal to”, “Like”, “Null”. Not all data sources support all comparators.
- Value: The value to be compared.
drop-down
required
The data source filters you have defined can be combined using either And or Or logic. If And, then all filter conditions must be satisfied to load the data row. If Or, then only a single filter condition must be satisfied. The default is And.If you have only one filter, or no filters, this parameter is essentially ignored.
integer
Set a numeric value to limit the number of rows that are loaded. The default is an empty field, which will load all rows.
Destination
Select your cloud data warehouse.- Snowflake
- Databricks
- Amazon Redshift
drop-down
required
- Standard: The data will be staged in your storage location before being loaded into a table. This is the only setting currently available.
object selector
Select one or more columns to use as the table’s primary key. If you select multiple columns, the component creates a composite primary key using the combination of the selected columns.Leave this blank to create the table without a primary key.
drop-down
required
The Snowflake warehouse used to run the queries. The special value
[Environment Default] uses the warehouse defined in the environment. Read Overview of Warehouses to learn more.drop-down
required
The Snowflake database. The special value
[Environment Default] uses the database defined in the environment. Read Databases, Tables and Views - Overview to learn more.drop-down
required
The Snowflake schema. The special value
[Environment Default] uses the schema defined in the environment. Read Database, Schema, and Share DDL to learn more.string
required
The name of the table to be created in your Snowflake database. This table will be recreated and will drop any existing table of the same name.You can use a Table Input component in a transformation pipeline to access and transform this data after it has been loaded.
drop-down
required
Select a managed stage. The special value, [Custom], will create a stage “on the fly” for use solely within this component.
drop-down
required
Choose where the data is staged before being loaded into your Snowflake table using the drop-down menu.
- Existing Amazon S3 Location: Activates the S3 Staging Area property, allowing users to specify a custom staging area on Amazon S3. The Stage Authentication property is also activated, letting users select a method of authenticating the data staging.
- Existing Azure Blob Storage Location: Activates the Storage Account and Blob Container properties, allowing users to specify a custom staging location on Azure. The Stage Authentication property is also activated, letting users select a method of authenticating the data staging.
- Existing Google Cloud Storage Location: Activates the Storage Integration and GCS Staging Area properties, allowing users to specify a custom staging area within Google Cloud Storage.
- Snowflake Managed: Create and use a temporary internal stage on Snowflake for staging the data. This stage, along with the staged data, will cease to exist after loading is complete. This is the default setting.
drop-down
required
Select an authentication method for data staging. Only available when Stage Platform is set to either Existing Amazon S3 Location or Existing Azure Blob Storage Location.
- Credentials: Uses the credentials configured in the environment. If no credentials have been configured, an error will occur.
- Storage Integration: Use a Snowflake storage integration to authentication data staging.
drop-down
required
Select a Snowflake storage integration from the drop-down list. Storage integrations are required to permit Snowflake to read data from and write to your cloud storage location and must be set up in advance of selection.
drop-down
required
Select an S3 bucket for temporary storage. Ensure your access credentials have S3 access and permission to write to the bucket. The temporary objects created in this bucket will be removed again after the load completes.
drop-down
required
Select a storage account with your desired blob container to be used for staging the data. For more information, read Storage account overview.
drop-down
required
Select a Blob container to be used for staging the data. For more information, read Introduction to Azure Blob storage.
drop-down
required
The URL and path of the target Google Cloud Storage bucket to be used for staging the queried data.
Advanced Settings
- Snowflake
- Databricks
- Amazon Redshift
multiple drop-downs
required
- Clean Staged Files: Destroy staged files after loading data. Default is On.
- String Null is Null: Converts any strings equal to null into a null value. This is case-sensitive and only works with entirely lower-case strings. Default is Off.
- Recreate Target Table: Choose whether the component recreates its target table before the data load. If Off, the existing table will be used. Default is On.
- File Prefix: Give staged file names a prefix of your choice. Default is empty (no prefix).
- Trim String Columns: Remove leading and trailing characters from a string column. Default is On.
- Compression Type: Set the compression type to either gzip (default) or None.
drop-down
required
Decide how the files are encrypted inside the S3 bucket. This property is available when using an existing Amazon S3 location for staging.
- None: No encryption.
- SSE KMS: Encrypt the data according to a key stored on KMS. Read AWS Key Management Service (AWS KMS) to learn more.
- SSE S3: Encrypt the data according to a key stored on an S3 bucket. Read Using server-side encryption with Amazon S3-managed encryption keys (SSE-S3) to learn more.
drop-down
required
The ID of the KMS encryption key you have chosen to use in the Encryption property.
drop-down
required
Choose whether to automatically log debug information about your load. These logs can be found in the task history and should be included in support requests concerning the component. Turning this on will override any debugging connection options.
drop-down
required
The level of verbosity with which your debug information is logged. Levels above 1 can log huge amounts of data and result in slower execution. These logs can be found in the Message field of the Task history tab after pipeline execution and should be included in support requests concerning the component.
- Will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
- Will log everything included in Level 1, plus cache queries and additional information about the request, if applicable.
- Will additionally log the body of the request and the response.
- Will additionally log transport-level communication with the data source. This includes SSL negotiation.
- Will additionally log communication with the data source, as well as additional details that may be helpful in troubleshooting problems. This includes interface commands.
Data model
The JDBC driver for this component models MongoDB APIs as relational databases and stored procedures, which are documented in the data model. You’ll also find API limitations and requirements. Connection optionsConnecting to MongoDB Atlas
The following steps illustrate the recommended method of using the MongoDB Query component to connect to MongoDB Atlas clusters.Prerequisites
Configure Network Access in the MongoDB Atlas cluster to allow inbound traffic from instance’s IP address or range. Read Configure IP Access List Entries for details. Create or obtain credentials for a user with sufficient permission to read from the MongoDB Atlas cluster. Read Configure Database Users for details. Obtain the MongoDB Atlas cluster’s hostname and connection parameters from the MongoDB Atlas console as follows:- On the Database Deployments screen, click the Connect button for the desired cluster.
- Click Drivers → Java, then select version 4.3 or later.
-
Note the connection string that appears, as it contains details needed in the steps below. For example:
You need the cluster hostname portion of the string:
cluster-name.xxxx.mongodb.net, wherexxxxis a unique name. - Click Browse Collections and locate the desired cluster. Note the name of the Namespace for the cluster. This will be used for the Database property in the MongoDB Query component.
- Note the name of the desired table under the chosen Namespace. This will be used for the Data Source property of the MongoDB Query component.
Connection process
With the prerequisite steps completed as above, follow this process to create the connection.- In , open or create a new orchestration pipeline, and drag a new MongoDB Query component onto the canvas.
-
Configure the component’s Properties as follows, using the details collected from the MongoDB Atlas console:
-
Set the following Connection Options:
- Complete the remaining properties as appropriate.
Connecting to an Amazon DocumentDB Cluster
With your cluster created, make note of the cluster details (found by clicking on the cluster name on the Clusters page). The table below describes the mapping from the DocumentDB cluster details to the component properties:
In addition to the above details, set the following additional connection options (in the Connection Options component property) to connect to an Amazon DocumentDB cluster:
