---
schema_version: "1"
id: cd9abdb9db8bec1f2ff7c7f2a95b5aed5a55a4473983071ea2bbe5fa39f24917
title: Using Anypoint Studio to Configure MongoDB Connector 6.4
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mongodb-connector/latest/mongodb-connector-studio.md
canonical_url: https://docs.mulesoft.com/mongodb-connector/latest/mongodb-connector-studio
source_site: docs.mulesoft.com
content_type: documentation
content_hash: db795d43c95836a9dc27f1672d040c857838d73f3d3ff5205aa49ca6cb8ad930
description: MuleSoft Documentation Site
release: "6.4"
latest: true
---
---
product: MongoDB Connector
version: 6.4
is-latest-version: true
---

# Using Anypoint Studio to Configure MongoDB Connector 6.4

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and
configuration files.

To add and configure a connector in Studio:

1.  [Create a Mule project](#create-mule-project).

2.  [Add the connector to your Mule project](#add-connector-to-project).

3.  [Configure an input source for the connector’s flow](#configure-input-source).

4.  [Add a connector operation to the flow](#add-connector-operation).

5.  [Configure a global element for the connector](#configure-global-element).

6.  [Configure the other connector fields](#configure-other-fields).

If you are new to configuring connectors in Studio, see
[Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio).
If, after reading this topic, you need additional information about the connector fields, see the
[MongoDB Connector Reference](https://docs.mulesoft.com/mongodb-connector/latest/mongodb-connector-reference).

## Create a Mule Project

In Studio, create a new Mule project in which to add and configure the connector:

1.  In Studio, select **File > New > Mule Project**.

2.  Enter a name for your Mule project and click **Finish**.

## Add the Connector to Your Mule Project

Add <connector name> to your Mule project to automatically populate the XML code with the
connector’s namespace and schema location and add the required dependencies to the project’s
`pom.xml` file:

1.  In the **Mule Palette** view, click **(X) Search in Exchange**.

2.  In **Add Modules to Project**, type `mongodb` in the search field.

3.  Click **MongoDB** in **Available modules**.

4.  Click **Add**.

5.  Click **Finish**.

Adding a connector to a Mule project in Studio does not make that connector available to other
projects in your Studio workspace.

## Configure an Input Source for the Connector

Configure an input source for the connector, such as the Object Listener operation, HTTP Listener,
or Scheduler. The Object Listener operation polls the given MongoDB collection for new documents
that apply to the filter and invokes your app when it finds one.

For example, to configure `HTTP Listener`, follow these steps:

1.  In the **Mule Palette** view, select **HTTP** > **Listener**.

2.  Drag **Listener** to the Studio canvas.

3.  On the **Listener** configuration screen, optionally change the value of the **Display Name**
    field.

4.  Specify a value for the **Path** field.

5.  Click the plus sign (+) next to the **Connector configuration** field to configure a global
    element that can be used by all instances of `HTTP Listener` in the app.

6.  On the **General** tab, specify connection information.

7.  On the **TLS** tab, optionally specify TLS information.

8.  On the **Advanced** tab, optionally specify reconnection information, including a reconnection
    strategy.

9.  Click **Test Connection** to confirm that Mule can connect with the specific server.

10. Click **OK**.

## Add a Connector Operation to the Flow

When you add a connector operation to your flow, you immediately define a specific operation for
that connector to perform.

To add an operation for MongoDB, follow these steps:

1.  In the **Mule Palette** view, select **MongoDB** and then select the desired operation.

2.  Drag the operation onto the Studio canvas to the right of the input source.

## Configure a Global Element for the Connector

When you configure a connector, it’s best to configure a global element that all instances of that
connector in the app can use. Configuring a global element requires you to provide the
authentication credentials the connector uses to access the target MongoDB system.

To configure the global element for MongoDB Connector, follow these steps:

1.  On the **Global Elements** tab, click **Create**.

2.  Expand **Connector Configuration** and search for `MongoDB config`.

3.  Click **OK**.

4.  Enter a value for the following properties:

    - **Servers (host:port)**

      Servers where your MongoDB instance is located, as specified by one or more host:port pairs.
      The default value is `localhost:27017`. Follow these steps to add one or more host:port
      instances:

      1.  Select **Edit inline**.

      2.  Click the green plus sign (+).

      3.  Add the host:port instance and click **Finish**.

      4.  Repeat steps 2 and 3 for each host:port instance you want to add.

    - **Database**

      Database that sends and retrieves data from the MongoDB instance

    - **Username**

      Username to access the MongoDB instance

    - **Password**

      Corresponding password

Use the MongoDB configuration with Spring property placeholders for the **Connection** field values
when you plan to deploy your application to CloudHub or to Mule runtime engine. You can hard code
your connection credentials in the global element properties if you are in the development stage and
want to accelerate the development process.

## Global Configuration with SSL (Optional)

MongoDB Connector v6.0.0 and later supports the use of SSL, if your MongoDB instance supports it. To
set up the global configuration for SSL, select the **TLS context** field in the **Security** tab in
your MongoDB connection.

## Logging

By default, logging is enabled via SLF4J API. The driver uses the following logger names:

- `org.mongodb.driver`, the root logger

  - `cluster`, for logs related to monitoring of the MongoDB servers to which the driver connects

  - `connection`, for logs related to connections and connection pools

  - `protocol`, for logs related to protocol message sent to and received from a MongoDB server

    - `insert`, for logs related to insert messages and responses

    - `update`, for logs related to update messages and responses

    - `delete`, for logs related to delete messages and responses

    - `query`, for logs related to query messages and responses

    - `getmore`, for logs related to getmore messages and responses

    - `killcursor`, for logs related to killcursor messages and responses

    - `command`, for logs related to command messages and responses

  - `uri`, for logs related to connection string parsing

  - `management`, for logs related to JMX

## Next Steps

After configuring Studio, see the [Examples](https://docs.mulesoft.com/mongodb-connector/latest/mongodb-connector-examples) topic for more
configuration ideas.

## See Also

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Salesforce Help](https://help.salesforce.com)
