Submit a ticket My tickets
Welcome
Login  Sign up

MongoDB Connector

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 object
DataGalaxy object
DataGalaxy attributes
Comments
DatabsesDirectoryCurrent storage size,
Storage unit

CollectionDocumentNumber of records 
SchemaField / Sub-StructureIndexed The 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:

ParamterAuthentification 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-1
Yes
Passwordscram-sha-256,
scram-sha-1
Yes
Serverscram-sha-256,
scram-sha-1
YesName or IP address of the MongoDB server
Portscram-sha-256,
scram-sha-1
YesBy default the port of a MongoDB database is 27017
Databasescram-sha-256,
scram-sha-1
YesName of the MongoDB database
Advanced modescram-sha-256,
scram-sha-1
NoOption that allows to override the connection URL to a MongoDB database
URLscram-sha-256,
scram-sha-1
Yes 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

  • Clic 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

2. Click on Database in the DEPLOYMENT menu on the left

3. Click on the "Connect" button corresponding to the Database whose metadata you want to export

4. Click on "Connect your application". 

5. Copy the connection URL: 

6. 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

7. Create a MongoDB connection in the DataGalaxy platform 

Releases

DatePlugin
Version
DataGalaxy
release
Desktop Connector
version (minimum)
Description
19/09/20243.0.1v3.74.05.0.1Fix in management of CLI properties
02/07/20243.0.0v3.55.0
5.0.1Migrated from java 11 to java 17 + CVE fixes

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.