MongoDB Query
    • Dark
      Light

    MongoDB Query

    • Dark
      Light

    Article Summary

    Overview

    The MongoDB Query component connects to a MongoDB server to retrieve data and then load that data into a table. This action stages the data, so the table is reloaded each time. Users can then transform their data with the Matillion ETL library of transformation components.


    Please Note

    When connecting to a MongoDB instance with security enabled, users must specify the AuthDatabase parameter in the Connection Options property. When connecting to a replica set, users should familiarise themselves with the ReadPreference connection option.


    Properties

    Snowflake Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    Basic/Advanced ModeSelectBasic: This mode will build a MongoDB Query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
    Advanced: This mode will require you to write an SQL-like query, which is translated into one or more MongoDB queries.
    PortIntegerSpecify a port number. The default, 27017, is used if this is left blank.
    UsernameStringInput a valid MongoDB username for authentication.
    PasswordStringInput a valid password corresponding to the specified username. Users can store their passwords within the component; however, Matillion recommends using the Matillion ETL Password Manager feature instead.
    ServerStringThe server IP or DNS address of the MongoDB server endpoint. <cluster-name>.cluster-xxxxxxxxxxxx.<region>.docdb.amazonaws.com
    DatabaseStringProvided the name of the MongoDB server's database.
    Flatten ObjectsYes | NoYes: 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 in order 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 Job after being staged.
    Flatten ArraysIntegerSet 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 in order to determine which fields are available.
    Connection OptionsParameterA JDBC parameter supported by the database driver. The available connection options are explained in the data model.
    They are usually not required, since sensible defaults are assumed.
    ValueA value for the given parameter.
    SQL QueryStringInput an SQL-like query, written according to the MongoDB Data Model.
    (This property is only available in "Advanced" Mode.)
    Data SourceSelectSelect a data source.
    Data SelectionSelectSelect one or more columns from the chosen data source to return from the query.
    Data Source FilterInput ColumnSelect an input column for your filter. The available input columns vary depending upon the data source.
    QualifierIs: 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.
    ComparatorSelect the comparator. Note: Not all comparators will work with all possible data sources.
    Choose one of "Equal to", "Greater than", "Less than", "Greater than or equal to", "Less than or equal to", or "Like".
    "Equal to" can match exact strings and numeric values, while other comparators such as "Greater than" and "Less than" will work only with numerics. The "Like" comparator allows the wildcard character % to be used at the start and end of a string value to match a column. The "Null" comparator matches only null values, ignoring whatever the value is set to.
    Note: Not all data sources support all comparators, meaning that, often, only a subset of the above comparators will be available for selection.
    ValueSpecify value to be compared.
    Combine FiltersSelectUse the defined filters in combination with one another according to either And or Or.
    LimitIntegerSet a numeric value to limit the number of rows that can be loaded.
    TypeSelectChoose between using a standard table or an external table.
    External: The data will be put into an S3 bucket and referenced by an external table.
    Standard: The data will be staged on an S3 bucket before being loaded into a table. This is the default setting.
    Primary KeysSelectSelect one or more columns to be designated as the table's primary key.
    WarehouseSelectChoose a Snowflake warehouse that will run the load.
    DatabaseSelectChoose a database to create the new table in.
    SchemaSelectSelect the table schema. The special value, [Environment Default], will use the schema defined in the environment. For more information on using multiple schemas, see this article.
    Target TableStringProvide a new table name.
    Warning: This table will be recreated and will drop any existing table of the same name.
    StageSelectSelect a managed stage. The special value, [Custom], will create a stage "on the fly" for use solely within this component. Selecting [Custom] provides all the properties typically seen in the Manage Stages dialog for your input.
    If you select a managed stage that has already been configured in Manage Stages, the additional properties are not provided, as they have already been configured.
    Manage Stages can be found by clicking the Environments panel in the lower-left, then right-clicking an environment. To learn more, read Manage Stages.
    Stage PlatformSelectSelect a staging setting.
    Snowflake Managed: Allow Matillion ETL to 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.
    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 GCS Staging Area property, allowing users to specify a custom staging area within Google Cloud Storage.
    Stage AuthenticationSelectSelect an authentication method for data staging.
    Credentials: Uses the credentials configured in the Matillion ETL environment. If no credentials have been configured, an error will occur.
    Storage Integration: Use a Snowflake storage integration to authentication data staging. A storage integration is a Snowflake object that stores a generated identity and access management (IAM) entity for your external cloud storage, along with an optional set of allowed or blocked storage locations. To learn more, read Create Storage Integration.
    Storage IntegrationSelectSelect a Snowflake storage integration from the dropdown list. Storage integrations are required to permit Snowflake to read data from and write to your cloud storage location (Amazon S3, Microsoft Azure, Google Cloud Storage) and must be set up in advance of selection.
    To learn more about setting up a storage integration for use in Matillion ETL, read Storage Integration Setup Guide.
    This property is only available when Stage Authentication is set to Storage Integration.
    S3 Staging AreaSelectSelect an S3 bucket for temporary storage. Ensure your access credentials have S3 access and permission to write to the bucket. Read Manage Credentials for details on setting up access. The temporary objects created in this bucket will be removed again after the load completes, they are not kept.
    Use Accelerated EndpointBooleanWhen True, data will be loaded via the s3-accelerate endpoint. Please consider the following information:
    • Enabling acceleration can enhance the speed at which data is transferred to the chosen S3 bucket. However, enhanced speed is not always guaranteed. Please consult Amazon S3 Transfer Acceleration Speed Comparison to compare S3 Direct versus S3 Accelerated Transfer speeds.
    • Users must manually set the acceleration configuration of an existing bucket. To learn more, see PutBucketAccelerateConfiguration in the API Reference, available at the AWS documentation.
    • This property is only available if the selected S3 bucket has Amazon S3 Transfer Acceleration enabled. For more information, including how to enable this feature, read Getting started with Amazon S3 Transfer Acceleration.
    • Cases may arise where Matillion ETL cannot determine whether the chosen S3 bucket has Amazon S3 Transfer Acceleration enabled. In these cases, Matillion ETL will reveal this property for user input on a "just in case" basis. In these cases, Matillion ETL may return a validation message that reads OK - Bucket could not be validated. You may also encounter cases where, if you do not have permission to get the status of the acceleration configuration (namely, the permission, GetAccelerateConfiguration) Matillion ETL will again show this property "just in case".
    • The default setting is False.
    Storage AccountSelectSelect a storage account with your desired blob container to be used for staging the data. For more information, read Storage account overview.
    Blob ContainerSelectSelect a Blob container to be used for staging the data. For more information, read Introduction to Azure Blob storage.
    GCS Staging AreaSelectThe URL and path of the target Google Storage bucket to be used for staging the queried data. For more information, read Creating storage buckets.
    EncryptionSelectDecide 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.
    KMS Key IDSelectThe ID of the KMS encryption key you have chosen to use in the Encryption property.
    Load OptionsMultiple SelectClean 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 component will use an existing table or create one if it does not exist. Default is On.
    File Prefix: Give staged file names a prefix of your choice. The default setting is an empty field.
    Trim String Columns: Remove leading and trailing characters from a string column. Default is On
    Compression Type: Set the compression type to either gzip or None. The default is gzip.
    Use Grid Variable: Check this checkbox to use a grid variable. This box is unchecked by default.
    New Table NameStringSpecify the name of the new table to be created.
    This property is only available when Type is set to External.
    Stage DatabaseSelect(Specify the stage database. The special value, [Environment Default], will use the database defined in the environment.
    This property is only available when Type is set to External.
    Stage SchemaSelectSpecify the stage schema. The special value, [Environment Default], will use the schema defined in the environment.
    This property is only available when Type is set to External.
    StageSelectSelect a stage.
    This property is only available when Type is set to External.
    Auto DebugSelectChoose 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.
    Debug LevelSelectThe level of verbosity with which your debug information is logged. Levels above 1 can log huge amounts of data and result in slower execution.
    1: Will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
    2: Will log everything included in Level 1, plus cache queries and additional information about the request, if applicable.
    3: Will additionally log the body of the request and the response.
    4: Will additionally log transport-level communication with the data source. This includes SSL negotiation.
    5: Will additionally log communication with the data source, as well as additional details that may be helpful in troubleshooting problems. This includes interface commands.

    Redshift Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    Basic/Advanced ModeSelectBasic: This mode will build a MongoDB Query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
    Advanced: This mode will require you to write an SQL-like query, which is translated into one or more MongoDB queries.
    PortIntegerSpecify a port number. The default, 27017, is used if this is left blank.
    UsernameStringInput a valid MongoDB username for authentication.
    PasswordStringInput a valid password corresponding to the specified username. Users can store their passwords within the component; however, Matillion recommends using the Matillion ETL Password Manager feature instead.
    ServerStringThe server IP or DNS address of the MongoDB server endpoint. <cluster-name>.cluster-xxxxxxxxxxxx.<region>.docdb.amazonaws.com
    DatabaseStringProvided the name of the MongoDB server's database.
    Flatten ObjectsYes | NoYes: 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 in order 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 Job after being staged.
    Flatten ArraysIntegerSet 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 in order to determine which fields are available.
    Connection OptionsParameterA JDBC parameter supported by the database driver. The available connection options are explained in the data model.
    They are usually not required, since sensible defaults are assumed.
    ValueA value for the given parameter.
    SQL QueryStringInput an SQL-like query, written according to the MongoDB data model.
    This property is only available when Basic/Advanced Mode is set to Advanced.
    Data SourceSelectSelect a data source.
    Data SelectionDual ListboxSelect one or more columns from the chosen data source to return from the query.
    Data Source FilterInput ColumnSelect an input column for your filter. The available input columns vary depending upon the data source.
    QualifierIs: 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.
    ComparatorSelect the comparator. Note: Not all comparators will work with all possible data sources.
    Choose one of "Equal to", "Greater than", "Less than", "Greater than or equal to", "Less than or equal to", or "Like".
    "Equal to" can match exact strings and numeric values, while other comparators such as "Greater than" and "Less than" will work only with numerics. The "Like" comparator allows the wildcard character % to be used at the start and end of a string value to match a column. The "Null" comparator matches only null values, ignoring whatever the value is set to.
    Note: Not all data sources support all comparators, meaning that, often, only a subset of the above comparators will be available for selection.
    ValueSpecify value to be compared.
    Combine FiltersSelectUse the defined filters in combination with one another according to either And or Or.
    LimitIntegerSet a numeric value to limit the number of rows that can be loaded. Fetching a large number of results will use multiple API calls. These calls are rate-limited by the provider, so fetching a very large number may result in errors.
    TypeSelectChoose between using a standard table or an external table.
    Standard: The data will be staged on an S3 bucket before being loaded into a table.
    External: The data will be put into an S3 bucket and referenced by an external table.
    SchemaSelectSelect the table schema. The special value, [Environment Default], will use the schema defined in the environment. For more information on using multiple schemas, read Schemas.
    Note: An external schema is required if the Type property is set to "External".
    Target TableStringProvide a new table name.
    Warning: This table will be recreated and will drop any existing table of the same name.
    LocationS3 BucketSelect an S3 bucket path that will be used to store the data. Once the data is on an S3 bucket, it can be referenced by an external table.
    This property is only available when the Type property is set to "External".
    S3 Staging AreaSelectSelect an S3 bucket for temporary storage. Ensure your access credentials have S3 access and permission to write to the bucket. Read Manage Credentials for details on setting up access. The temporary objects created in this bucket will be removed again after the load completes, they are not kept.
    Use Accelerated EndpointBooleanWhen True, data will be loaded via the s3-accelerate endpoint. Please consider the following information:
    • Enabling acceleration can enhance the speed at which data is transferred to the chosen S3 bucket. However, enhanced speed is not always guaranteed. Please consult Amazon S3 Transfer Acceleration Speed Comparison to compare S3 Direct versus S3 Accelerated Transfer speeds.
    • Users must manually set the acceleration configuration of an existing bucket. To learn more, see PutBucketAccelerateConfiguration in the API Reference, available at the AWS documentation.
    • This property is only available if the selected S3 bucket has Amazon S3 Transfer Acceleration enabled. For more information, including how to enable this feature, read Getting started with Amazon S3 Transfer Acceleration.
    • Cases may arise where Matillion ETL cannot determine whether the chosen S3 bucket has Amazon S3 Transfer Acceleration enabled. In these cases, Matillion ETL will reveal this property for user input on a "just in case" basis. In these cases, Matillion ETL may return a validation message that reads OK - Bucket could not be validated. You may also encounter cases where, if you do not have permission to get the status of the acceleration configuration (namely, the permission, GetAccelerateConfiguration) Matillion ETL will again show this property "just in case".
    • The default setting is False.
    Distribution StyleSelectAll: Copy rows to all nodes in the Redshift cluster.
    Auto: (Default) Allow Redshift to manage your distribution style.
    Even: Distribute rows around the Redshift cluster evenly.
    Key: Distribute rows around the Redshift cluster according to the value of a key column.
    Table distribution is critical to good performance. See the Distribution styles documentation for more information.
    Sort KeyMultiple SelectThis is optional, and lets users specify one or more columns from the input that should be set as the table's sort key.
    Sort keys are critical to good performance. Read Working with sort keys for more information.
    Sort Key OptionsSelectDecide whether the sort key is of a compound or interleaved variety. Read Working with sort keys for more information.
    Primary KeyMultiple SelectSelect one or more columns to be designated as the table's primary key.
    Load OptionsMultiple Select ColumnsComp Update: Apply automatic compression to the target table. Default is On.
    Stat Update: Automatically update statistics when filling a table. Default is On. In this case, it is updating the statistics of the target table.
    Clean S3 Objects: Automatically remove UUID-based objects on the S3 bucket. Default is On. Effectively, users decide here whether to keep the staged data in the S3 bucket or not.
    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 On.
    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. When this Load Option is selected, users should set their preferred prefix in the text field.
    Compression Type: Set the compression type to either gzip or None. The default is gzip.
    Use Grid Variable: Check this checkbox to use a grid variable. This box is unchecked by default.
    EncryptionSelectDecide 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.
    KMS Key IDSelectThe ID of the KMS encryption key you have chosen to use in the Encryption property.
    Auto DebugSelectChoose 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.
    Debug LevelSelectThe level of verbosity with which your debug information is logged. Levels above 1 can log huge amounts of data and result in slower execution.
    1: Will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
    2: Will log everything included in Level 1, plus cache queries and additional information about the request, if applicable.
    3: Will additionally log the body of the request and the response.
    4: Will additionally log transport-level communication with the data source. This includes SSL negotiation.
    5: Will additionally log communication with the data source, as well as additional details that may be helpful in troubleshooting problems. This includes interface commands.

    BigQuery Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    Basic/Advanced ModeSelectBasic: This mode will build a MongoDB Query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
    Advanced: This mode will require you to write an SQL-like query, which is translated into one or more MongoDB queries.
    PortIntegerSpecify a port number. The default, 27017, is used if this is left blank.
    UsernameStringInput a valid MongoDB username for authentication.
    PasswordStringInput a valid password corresponding to the specified username. Users can store their passwords within the component; however, Matillion recommends using the Matillion ETL Password Manager feature instead.
    ServerStringThe server IP or DNS address of the MongoDB server endpoint. <cluster-name>.cluster-xxxxxxxxxxxx.<region>.docdb.amazonaws.com
    DatabaseStringProvided the name of the MongoDB server's database.
    Flatten ObjectsYes | NoYes: 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 in order 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 Job after being staged.
    Flatten ArraysIntegerSet 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 in order to determine which fields are available.
    Connection OptionsParameterA JDBC parameter supported by the database driver. The available connection options are explained in the data model.
    They are usually not required, since sensible defaults are assumed.
    ValueA value for the given parameter.
    SQL QueryStringInput an SQL-like query, written according to the MongoDB Data Model.
    (This property is only available in "Advanced" Mode.)
    Data SourceSelectSelect a data source.
    Data SelectionSelectSelect one or more columns from the chosen data source to return from the query.
    Data Source FilterInput ColumnSelect an input column for your filter. The available input columns vary depending upon the data source.
    QualifierIs: 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.
    ComparatorSelect the comparator. Note: Not all comparators will work with all possible data sources.
    Choose one of "Equal to", "Greater than", "Less than", "Greater than or equal to", "Less than or equal to", or "Like".
    "Equal to" can match exact strings and numeric values, while other comparators such as "Greater than" and "Less than" will work only with numerics. The "Like" comparator allows the wildcard character % to be used at the start and end of a string value to match a column. The "Null" comparator matches only null values, ignoring whatever the value is set to.
    Note: Not all data sources support all comparators, meaning that, often, only a subset of the above comparators will be available for selection.
    ValueSpecify value to be compared.
    Combine FiltersSelectUse the defined filters in combination with one another according to either And or Or.
    LimitIntegerSet a numeric value to limit the number of rows that can be loaded.
    Table TypeSelectSelect whether the table is Native (by default in BigQuery) or an external table.
    ProjectSelectThe target BigQuery project to load data into. The special value, [Environment Default], will use the project defined in the Matillion ETL environment.
    DatasetSelectThe target BigQuery dataset to load data into. The special value, [Environment Default], will use the dataset defined in the Matillion ETL environment.
    Target TableStringA name for the table.
    Warning: This table will be recreated and will drop any existing table of the same name.
    Only available when the table type is Native.
    New Target TableStringA name for the new external table.
    Only available when the table type is External.
    Cloud Storage Staging AreaCloud Storage BucketThe URL and path of the target Google Cloud Storage bucket to be used for staging the queried data.
    Only available when the table type is Native.
    LocationCloud Storage BucketThe URL and path of the target Google Cloud Storage bucket.
    Only available when the table type is External.
    Load OptionsMultiple SelectClean Cloud Storage Files: Destroy staged files on Cloud Storage after loading data. Default is On.
    Cloud Storage File Prefix: Give staged file names a prefix of your choice. The default setting is an empty field.
    Recreate Target Table: Choose whether the component recreates its target table before the data load. If Off, the component will use an existing table or create one if it does not exist. Default is On.
    Use Grid Variable: Check this checkbox to use a grid variable. This box is unchecked by default.
    Only available when the table type is Native.
    Auto DebugSelectChoose 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.
    Debug LevelSelectThe level of verbosity with which your debug information is logged. Levels above 1 can log huge amounts of data and result in slower execution.
    1: Will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
    2: Will log everything included in Level 1, plus cache queries and additional information about the request, if applicable.
    3: Will additionally log the body of the request and the response.
    4: Will additionally log transport-level communication with the data source. This includes SSL negotiation.
    5: Will additionally log communication with the data source, as well as additional details that may be helpful in troubleshooting problems. This includes interface commands.

    Synapse Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    Basic/Advanced ModeSelectBasic: This mode will build a MongoDB Query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
    Advanced: This mode will require you to write an SQL-like query, which is translated into one or more MongoDB queries.
    PortIntegerSpecify a port number. The default, 27017, is used if this is left blank.
    UsernameStringInput a valid MongoDB username for authentication.
    PasswordStringInput a valid password corresponding to the specified username. Users can store their passwords within the component; however, Matillion recommends using the Matillion ETL Password Manager feature instead.
    ServerStringThe server IP or DNS address of the MongoDB server endpoint. <cluster-name>.cluster-xxxxxxxxxxxx.<region>.docdb.amazonaws.com
    DatabaseStringProvided the name of the MongoDB server's database.
    Flatten ObjectsYes | NoYes: 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 in order 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 Job after being staged.
    Flatten ArraysIntegerSet 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 in order to determine which fields are available.
    Connection OptionsParameterA JDBC parameter supported by the database driver. The available connection options are explained in the data model.
    They are usually not required, since sensible defaults are assumed.
    ValueA value for the given parameter.
    SQL QueryStringInput an SQL-like query, written according to the MongoDB Data Model.
    (This property is only available in "Advanced" Mode.)
    Data SourceSelectSelect a data source.
    Data SelectionSelectSelect one or more columns from the chosen data source to return from the query.
    Data Source FilterInput ColumnSelect an input column for your filter. The available input columns vary depending upon the data source.
    QualifierIs: 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.
    ComparatorSelect the comparator. Note: Not all comparators will work with all possible data sources.
    Choose one of "Equal to", "Greater than", "Less than", "Greater than or equal to", "Less than or equal to", or "Like".
    "Equal to" can match exact strings and numeric values, while other comparators such as "Greater than" and "Less than" will work only with numerics. The "Like" comparator allows the wildcard character % to be used at the start and end of a string value to match a column. The "Null" comparator matches only null values, ignoring whatever the value is set to.
    Note: Not all data sources support all comparators, meaning that, often, only a subset of the above comparators will be available for selection.
    ValueSpecify value to be compared.
    Combine FiltersSelectUse the defined filters in combination with one another according to either And or Or.
    LimitIntegerSet a numeric value to limit the number of rows that can be loaded.
    SchemaSelectSelect the table schema. The special value, [Environment Default], will use the schema defined in the environment. For more information on schemas, please see the Azure Synapse documentation.
    TableStringProvide a new table name.
    Warning: This table will be recreated on each run of the job, and drop any existing table of the same name.
    Storage AccountSelectSelect an Azure storage account with your desired blob container to be used for staging the data.
    Please visit the Azure documentation for help creating an Azure Storage Account.
    Blob ContainerSelectSelect a blob container to be used for staging the data. The blob containers available for selection depend on the chosen storage account.
    Load OptionsMultiple SelectConfigure this Orchestration Job's load options. These load options will apply each time the job runs. Sensible defaults are assumed.
    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 load option 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 set to Off, the existing table will be used instead. Default is On.
    File Prefix: Give staged file names a prefix of your choice. The default setting is an empty field.
    Compression Type: Set the compression type to either gzip or None. The default is gzip.
    Use Grid Variable: Check this checkbox to use a grid variable. This box is unchecked by default.
    Distribution StyleSelectSelect the distribution style
    Hash: This setting assigns each row to one distribution by hashing the value stored in the distribution_column_name. The algorithm is deterministic, meaning it always hashes the same value to the same distribution. The distribution column should be defined as NOT NULL, because all rows that have NULL are assigned to the same distribution.
    Replicate: This setting stores one copy of the table on each Compute node. For SQL Data Warehouse, the table is stored on a distribution database on each Compute node. For Parallel Data Warehouse, the table is stored in an SQL Server filegroup that spans the Compute node. This behavior is the default for Parallel Data Warehouse.
    Round Robin: Distributes the rows evenly in a round-robin fashion. This is the default behaviour.
    For more information, please read this article.
    Distribution ColumnSelectSelect the column to act as the distribution column. This property is only available when the Distribution Style property is set to "Hash".
    Index TypeSelectSelect the table indexing type. Options include:
    Clustered: A clustered index may outperform a clustered columnstore table when a single row needs to be retrieved quickly. The disadvantage to using a clustered index is that only queries that benefit are the ones that use a highly selective filter on the clustered index column. Choosing this option prompts the Index Column Grid property.
    Clustered Column Store: This is the default setting. Clustered columnstore tables offer both the highest level of data compression and the best overall query performance, especially for large tables. Choosing this option prompts the Index Column Order property.
    Heap: Users may find that using a heap table is faster for temporarily landing data in Synapse SQL pool. This is because loads to heaps are faster than to index tables, and in some cases, the subsequent read can be done from cache. When a user is loading data only to stage it before running additional transformations, loading the table to a heap table is much faster than loading the data to a clustered columnstore table.
    For more information, please consult the Azure Synapse documentation.
    Index Column GridNameThe name of each column.
    SortAssign a sort orientation of either ascending (Asc) or descending (Desc).
    Index Column OrderMultiple SelectSelect the columns in the order to be indexed.
    Partition KeySelectSelect the table's partition key. Table partitions determine how rows are grouped and stored within a distribution.
    For more information on table partitions, please refer to this article.
    Auto DebugSelectChoose 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.
    Debug LevelSelectThe level of verbosity with which your debug information is logged. Levels above 1 can log huge amounts of data and result in slower execution.
    1: Will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
    2: Will log everything included in Level 1, plus cache queries and additional information about the request, if applicable.
    3: Will additionally log the body of the request and the response.
    4: Will additionally log transport-level communication with the data source. This includes SSL negotiation.
    5: Will additionally log communication with the data source, as well as additional details that may be helpful in troubleshooting problems. This includes interface commands.

    Delta Lake Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    Basic/Advanced ModeSelectBasic: This mode will build a query using settings from the Data Source, Data Selection, and Data Source Filter properties. In most cases, this mode will be sufficient.
    Advanced: This mode will require you to write an SQL-like query. The available fields and their descriptions are documented in the Data Model.
    PortIntegerSpecify a port number. The default, 27017, is used if this is left blank.
    UsernameStringInput a valid MongoDB username for authentication.
    PasswordStringInput a valid password corresponding to the specified username. Users can store their passwords within the component; however, Matillion recommends using the Matillion ETL Password Manager feature instead.
    ServerStringThe server IP or DNS address of the MongoDB server endpoint. <cluster-name>.cluster-xxxxxxxxxxxx.<region>.docdb.amazonaws.com
    DatabaseStringProvided the name of the MongoDB server's database.
    Flatten ObjectsYes | NoYes: 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 in order 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 Job after being staged.
    Flatten ArraysIntegerSet 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 in order to determine which fields are available.
    Connection OptionsParameterA JDBC parameter supported by the database driver. The available connection options are explained in the data model.
    They are usually not required, since sensible defaults are assumed.
    ValueA value for the given parameter.
    SQL QuerySQLManually write the component's query in an SQL-like fashion. This property is only available when Basic/Advanced Mode is set to "Advanced".
    Data SourceSelectSelect a data source.
    Data SelectionSelectSelect one or more columns from the chosen data source to return from the query.
    Data Source FilterInput ColumnThe available input columns vary depending upon the data source.
    QualifierIs: 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.
    ComparatorChoose 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".
    "Equal to" can match exact strings and numeric values, while other comparators, such as "Greater than", will work only with numerics. The "Like" operator allows the wildcard character (%) to be used at the start and end of a string value to match a column. The "Null" operator matches only null values, ignoring whatever the value is set to.
    Not all data sources support all comparators, thus it is likely that only a subset of the above comparators will be available to choose from.
    ValueThe value to be compared.
    Combine FiltersSelectUse the defined data source filters in combination with one another according to either And or Or.
    LimitIntegerSet a numeric value to limit the number of rows that can be loaded.
    CatalogSelectSelect a Databricks Unity Catalog. The special value, [Environment Default], will use the catalog specified in the Matillion ETL environment setup. Selecting a catalog will determine which databases are available in the next parameter.
    DatabaseSelectSelect the Delta Lake database. The special value, [Environment Default], will use the database specified in the Matillion ETL environment setup.
    TableStringSpecify the new table name.
    S3 Staging AreaSelect(AWS only) Select an S3 bucket for staging.
    Storage AccountSelect(Azure only) Select an Azure Blob Storage account. An Azure storage account contains all of your Azure Storage data objects: blobs, files, queues, tables, and disks. For more information, read Storage account overview.
    Blob ContainerSelect(Azure only) A Blob Storage location. The available blob containers will depend on the selected storage account.
    EncryptionSelect(AWS only) Specify how files are encrypted inside the S3 Bucket.
    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.
    KMS Key IDSelect(AWS only) The ID of the KMS encryption key you have chosen to use in the Encryption property.
    Load OptionsMultiple SelectClean Staged Files: Destroy staged files after loading data. The 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. The default is Off.
    Recreate Target Table Choose whether the component recreates its target table before the data load. If Off, the component will use an existing table or create one if it does not exist. The default is On.
    File Prefix: Give staged file names a prefix of your choice. The default is an empty field (no prefix).
    Compression Type: Set the compression type to either gzip or None. The default is gzip.
    Use Grid Variable: Check this checkbox to use a grid variable. This box is unchecked by default.
    Auto DebugSelectChoose whether to automatically log debug information about your load or not. 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.
    Debug LevelSelectThe level of verbosity with which your debug information is logged. Levels above 1 can log huge amounts of data and result in slower execution.
    1: Will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
    2: Will log everything included in Level 1, plus cache queries and additional information about the request, if applicable.
    3: Will additionally log the body of the request and the response.
    4: Will additionally log transport-level communication with the data source. This includes SSL negotiation.
    5: Will additionally log communication with the data source, as well as additional details that may be helpful in troubleshooting problems. This includes interface commands.

    Variable Exports

    This component makes the following values available to export into variables:

    SourceDescription
    Time Taken To StageThe amount of time (in seconds) taken to fetch the data from the data source and upload it to storage.
    Time Taken To LoadThe amount of time (in seconds) taken for the COPY statement to load the data into the target table from the staging area.

    Strategy

    Connect to the MongoDB Server and issue the one or more queries. Stream the results into objects into a storage area, recreate or truncate the target table as necessary and then use a COPY command to load the stored objects into the table. Finally, clean up the temporary stored objects.


    Connecting to Mongo Atlas

    It is possible to use the MongoDB Query component to connect to Mongo Atlas with minor alterations of the Connection Options:

    1. Whitelist the Matillion ETL instance IP in the Atlas Cluster Security console.
    2. Using the Atlas Cluster Security console, grant user read privileges on the collection to be queried by Matillion.
    3. Set the Server property on the MongoDB Query component to the primary server's hostname.
    4. Set Connection Option UseSSL to true.
    5. Set Connection Option AuthDatabase to admin.
    6. In text mode, add a ReplicaSet Connection Option containing a comma-separated list of all the hostnames in the replica set, including their port number. For example:
      matil-dsl-shard-00-00-vli5t.mongodb.net:27017, matil-dsl-shard-00-01-vli5t.mongodb.net:27017,matil-dsl-shard-00-02-vli5t.mongodb.net:27017

    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:

    MongoDB Query Component propertyTypeAmazon DocumentDB property (Value)
    PortIntegerSpecify a port number. The default, 27017, is used if this is left blank.
    UsernameStringInput a valid MongoDB username for authentication.
    PasswordStringInput a valid password corresponding to the specified username. Users can store their passwords within the component; however, Matillion recommends using the Matillion ETL Password Manager feature instead.
    ServerStringThe server IP or DNS address of the MongoDB server endpoint. The format is:
    <cluster-name>.cluster-xxxxxxxxxxxx.<region>.docdb.amazonaws.com

    In addition to the above details, users need to set the following additional connection options (in the Connection Options component property) to connect to an Amazon DocumentDB cluster:

    Connection OptionValueDescription
    UseSSLTrueAmazon DocumentDB Clusters have SSL enabled by default and this cannot be changed.
    SSLServerCert*This automatically accepts the certificate presented by the DocumentDB Cluster, which is already hosted within the same region and security group as the EC2 instance.
    Other"UseFindAPI=true"This is set to ensure compatibility with the DocumentDB version of the MongoDB API.

    Video


    What's Next