MongoDB Connector

Configure and run the MongoDB connector to import metadata into DataGalaxy.

4 min read

This article describes how to use MongoDB Connector

This connector is available in the following modes:

Desktop mode ✅SaaS Online mode ✅

Connector scope

The connector allows you to import the following metadata from a MongoDB database:

  • The set of collections in a database
  • The schema of collections

By default, the following attributes are populated for the entire scope:

  • Functional and technical labels

Additional attributes are also filled in depending on the technology and by type of object. To make them appear in DataGalaxy screens, it may be necessary to adapt the screens of the concerned objects. See this article to learn more about screen customization.

The following table details the objects and attributes retrieved, and their correspondences in DataGalaxy :

MongoDB objectDataGalaxy objectDataGalaxy attributesComments
DatabasesDirectoryCurrent storage size, Storage unit
CollectionDocumentNumber of records
SchemaField / Sub-StructureIndexedThe schema is deduced by the connector from a sample of documents (see parameters). Embedded objects are represented by exploiting the notion of DataGalaxy sub structure when necessary.

Configuration of a connection

The MongoDB connector uses the mongodb-driver-sync driver. SSL/TLS is activated by default in the connection string using the option ?ssl=true. If you use private certificates, you'll need to add the CA certs in the Java keystore of the embedded JRE (or your JRE if you don't use the embedded one) as described in this documentation.

It is also possible to connect to a MongoDB database on Azure's CosmoDB via a principal service. The service account must have the following rights:

  • Contributor or Owner on the CosmoDB resource (in order to have the necessary rights to retrieve the authentication key of the resource).

It also allows you to connect to MongoDB Cloud Atlas via an advanced mode connection (see the "Configuration of a MongoDB Cloud Atlas connection" section for the connection procedure).

The following information is required to set up a connection:

ParameterAuthentification ModeMandatoryDescription
Authentification methodAllYesAllows you to select an authentication mode: Azure main service, scram-sha-256 (default MongoDB authentication mode) or scram-sha-1
Sample size to useAllYesNumber of rows in the database read to retrieve the schemas. The default value is 100.
Subcription IdAzure principal serviceYesAzure Subscription ID
Account NameAzure principal serviceYesAzure CosmosDB account name
Ressource group nameAzure principal serviceYesAzure resource group name
Client IdAzure principal serviceYesAzure Client Service Account ID
Tenant IdAzure principal serviceYesAzure tenant ID
Client SecretAzure principal serviceYesAzure client secret
Userscram-sha-256, scram-sha-1Yes
Passwordscram-sha-256, scram-sha-1Yes
Serverscram-sha-256, scram-sha-1YesName or IP address of the MongoDB server
Portscram-sha-256, scram-sha-1YesBy default the port of a MongoDB database is 27017
Databasescram-sha-256, scram-sha-1YesName of the MongoDB database
Advanced modescram-sha-256, scram-sha-1NoOption that allows to override the connection URL to a MongoDB database
URLscram-sha-256, scram-sha-1Yes for advanced modeConnection URL, example: mongodb://mongodb0.example.com:27017/?authSource=admin

Execution of the connector

Step 1: Installation

  • Download DataGalaxy connector from the portal (see here)
  • Extract the connector archive in the directory of your choice
  • Download the MongoDB plug-in from the portal and copy it into the /lib directory of the connector

Step 2: Run connector

  • After starting the connector, access the connectors of the Dictionary category
  • If it was correctly installed, the MongoDB plug-in will appear
  • Fill the corresponding fields using the connection information from above
  • Click on "Test" to test the connection
  • Once the connection test passed follow the steps to finalize your import

This connector is also available in online mode, more information on this page: [How to] Online Connector operating mode

Configuration of a MongoDB Cloud Atlas connection

This section explains all the steps you need to take to configure a MongoDB Atlas connection with the Online Connector.

  1. Connect to your Atlas Cloud portal
  1. Click on Database in the DEPLOYMENT menu on the left
  1. Click on the "Connect" button corresponding to the Database whose metadata you want to export
  1. Click on "Connect your application".
  1. Copy the connection URL:
  1. Modify login url to remove <username>:<password> which gives with the example of above the following value:
    mongodb+srv://datagalaxydemocluster0.7lzny2a.mongodb.net/?retryWrites=true&w=majority
  1. Create a MongoDB connection in the DataGalaxy platform

Releases

DatePlugin VersionDataGalaxy releaseDesktop Connector version (minimum)Description
29/09/20264.0.13.423.06.2.2New internal implementation to fix security vulnerabilities
19/09/20243.0.1v3.74.05.0.1Fix in management of CLI properties
02/07/20243.0.0v3.55.05.0.1Migrated from java 11 to java 17 + CVE fixes

Read more

Related articles

Was this page helpful?