You are interested in using the Connection String as the connection type for the MuleSoft MongoDB connector.
1. Download the MongoDB connector into Anypoint Studio.
-In the Mule Palette view, click (X) Search in Exchange.
-In the Add Dependencies to Project window, type MongoDB connector in the search field.
-Click MongoDB Connector - Mule 4 in Available modules.
-Click Add.
-Click Finish.
2. Drag the MongoDB connector operation you intend to use to your project's canvas.
3. In the connector's configuration section, create a new configuration.
4. Below General section > change the Connection type to "Connection String".
5. Configure the MongoDB Driver by adding the Maven dependency. For example:
6. For the Connection String field, as mentioned in the MongoDB documentation for Connection String URI Format. The standard URI connection scheme has the below format:
mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
7. For instance, let's say if the MongoDB parameters have the following values:
-username= support
-password= Passw0rd
-database host= localhost
-port number= 27017
-defaultauthdb= testdb
The connection string URL will be as below:
mongodb://support:Passw0rd@localhost:27017/testdb
8. Add the string ( created in step 7 above ) to the Connection String field and tap on the Test Connection button to validate the connection.
Disclaimer: This article involves products and technologies which do not form part of the MuleSoft product set. Technical assistance for such products is limited to this article.
001119060

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.