---
title: MongoDB
slug: mongodb
image: https://make-cxp-documentation.ams3.cdn.digitaloceanspaces.com/apps-center-icons/PREVIEW_DEFAULT.png
createdAt: 2025-02-03T13:28:13.883Z
---

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
::Image[**]{src="https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-fMzoU2zBbnzXG5pDzUALe-20250908-073345.png" size="50" width="800" height="800" position="center" darkWidth="800" darkHeight="800" showCaption="false"}
:::

:::VerticalSplitItem
MongoDB is a document database.&#x20;

With the MongoDB app in Make, you can manage documents individually or in bulk, and perform bulk query actions in your MongoDB account.
:::
::::

# Requirements

To use the MongoDB app in Make, you must have a [MongoDB account](https://www.mongodb.com/) and a running instance of a MongoDB database configured with public access to the Internet.&#x20;

# Connect MongoDB and Make&#x20;

To get started, you must first create a connection between MongoDB and Make, allowing the two services to communicate.

To create the connection, you need to:

::::WorkflowBlock
:::WorkflowBlockItem
[Whitelist IP addresses in MongoDB](docId:0TDO8R2aK8ijDp9No472X).
:::

:::WorkflowBlockItem
[Obtain the connection string in MongoDB](docId:0TDO8R2aK8ijDp9No472X).
:::

:::WorkflowBlockItem
[Create the connection in Make](docId:0TDO8R2aK8ijDp9No472X).
:::
::::

## Whitelist IP addresses in MongoDB

Before you create the connection in Make, you should first whitelist the required IP addresses in your MongoDB account.&#x20;

To do that:

:::::WorkflowBlock
:::WorkflowBlockItem
Log in to your MongoDB account.
:::

:::WorkflowBlockItem
In the header, select your **Organization** and **Project**.&#x20;
:::

:::WorkflowBlockItem
In the **SECURITY** section in the left sidebar, click, click **Network Access**.
:::

:::WorkflowBlockItem
Then, click **+ ADD IP ADDRESS**.

![](https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-M-5nNHtZg7SLkTAQlCaCl-20250908-065525.png)
:::

::::WorkflowBlockItem
For the **Access List Entry** field, enter the IP addresses for your zone and click **Confirm**.&#x20;

:::hint{type="info"}
You can find the Make IP addresses [here](https://help.make.com/allow-connections-to-and-from-make-ip-addresses).&#x20;
:::

::Image[]{src="https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-WlGWHyAe4VAJQFIi6eGB3-20250908-070003.png" size="60" width="1000" height="736" position="center" darkWidth="1000" darkHeight="736" showCaption="false"}
::::
:::::

## Obtain your connection string in Mongo DB

To create the connection in Make, you should also get the connection string from your MongoDB account.

To obtain the connection string:

:::::WorkflowBlock
:::WorkflowBlockItem
Log in to your MongoDB account.
:::

:::WorkflowBlockItem
In the header, select your **Organization** and **Project**.&#x20;
:::

:::WorkflowBlockItem
In the left sidebar, click **Clusters and&#x20;**&#x73;elect the Cluster you want to connect to.&#x20;

&#x20;Then clic&#x6B;**&#x20;Connect**.

![](https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-1EUq_kDmKCD46TSo-83qK-20250908-074434.png)
:::

:::WorkflowBlockItem
Click **Connect to your application** > **Drivers**.

![Connection string step 3](https://api.archbee.com/api/optimize/yAufeXqD1oGWOPBNi5MAm-qUk4MKhfVqoJKx4MmUpv0-20250304-141144.png)
:::

::::WorkflowBlockItem
Copy your **Connection string**.

::Image[]{src="https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-MezJ5DDjPgCYPJjDn8alu-20250908-075254.png" size="70" width="1410" height="1420" position="center" darkWidth="1410" darkHeight="1420" showCaption="false"}

While pasting this **Connection string&#x20;**&#x69;nto the **Connection string** field in Make, you need to replace `<username>` and `<db_password>`with your actual credentials.

You can obtain them from the MongoDB Admin. The Admin can either use personal credentials or create a dedicated database user for Make integration.

To create a new user:

- In the **SECURITY** section in the left sidebar, click **Database** **access.&#x20;**
- Click **+ADD NEW DATABASE USER**.
- Enter username and password, and click **Add** **user**.&#x20;

Once the user is created, the `<username>` and `<db_password>` can be replaced with these credentials while paste the Connection string into Make.

:::hint{type="info"}
You can also add the **database name** to the connection string (e.g., `mongodb+srv://<username>:<password>@myclass.9fnerah.mongodb.net/`<font color="#EF4444">`<database name>`</font>`?retrywrites=true&w=majority`). It will be chosen as a default option for the **Database** connection field in Make.
:::
::::
:::::

## Create the connection in Make&#x20;

Once you have your MongoDB connection string, you're ready to create the connection in Make.&#x20;

To create the connection:

::::WorkflowBlock
:::WorkflowBlockItem
Log in to your Make account, add an MongoDB module to your scenario, and click **Create a connection**.
:::

:::WorkflowBlockItem
Optional: In the **Connection name** field, enter a name for the connection.
:::

:::WorkflowBlockItem
In the **Connection string** field, enter the connection string copied above.
:::

:::WorkflowBlockItem
Click **Save**.
:::

:::WorkflowBlockItem
If prompted, authenticate your account and confirm access.
:::
::::

You have successfully created the connection and can now use the MongoDB app in your scenarios.  If you want to make changes to your connection in the future, follow the steps [here](docId\:SO88FM6pkT0G-adKDDfzZ).

# MongoDB modules

After connecting to the MongoDB app, you can use the following types of modules to build your scenarios:&#x20;

## Documents

::::ExpandableHeading
### Get a document

Retrieves a document by its Object ID or a query.

| **Field**                  | **Description**                                                                                                                               |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connection**             | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                   |
| **Database**               | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string. |
| **Collection**             | Enter the MongoDB collection name.                                                                                                            |
| **Document search method** | Select document search method:<br />- Enter Object ID<br />- Search by query                                                                  |
| **Object ID**              | Enter Object ID (e.g., 68c1688aeb6a133fb1d0e39d)                                                                                              |
| **Query**                  | Enter a query to specify the search.                                                                                                          |
| **Projection**             | Specify which fields to include or exclude from the query result.                                                                             |

:::ExpandableHeading{isOpen="true"}
**Example&#x20;**

If you select **Object ID** as &#x61;**&#x20;document search method,** you'll get the contents of that document in the output:

::Image[****]{src="https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-HoWEPZ_yCLjOlxtOCEpdC-20250910-122209.png" size="80" width="1354" height="1298" position="center" darkWidth="1354" darkHeight="1298" showCaption="false"}
:::
::::

::::ExpandableHeading
### Create a document

Creates a document using JSON or a data structure.

| **Field**                 | **Description**                                                                                                                                                                                                          |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Connection**            | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                                                                                              |
| **Database**              | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string.                                                                            |
| **Collection**            | Enter the MongoDB collection name.                                                                                                                                                                                       |
| **Document input method** | Select document creation method:<br />- Data structure<br />- JSON string                                                                                                                                                |
| **Data structure**        | Create a data structure or choose the existing one. Make sure to follow the[ Mongo DB Type Representations](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/#type-representations) for certain data. |
| **JSON string**           | Enter a JSON string with the data you want to add to the document.                                                                                                                                                       |

:::ExpandableHeading{isOpen="true"}
**Example&#x20;**

A simplified example could be when you pull the data from th&#x65;**&#x20;Google Sheets > Watch New Rows** module and want to create a document in MongoDB with this data (e.g., full name, age, and city). You can define the following data structure, and later map the values in the corresponding fields:

![](https://api.archbee.com/api/optimize/oAyFj2GHlBeBVWF5OAir2/N9E7YJzytLPTUQhoKnmh_-20250912-074714.png)

Or add data as a JSON string:

::Image[]{src="https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-rPMosflyG2QSybAot1Hlq-20250910-124402.png" size="40" width="790" height="1308" position="center" darkWidth="790" darkHeight="1308" showCaption="false"}

A document will be created in your MongoDB database:

::Image[]{src="https://api.archbee.com/api/optimize/PL8X94efBsjvhfQV3wyyj-Bm6jOsDRgD0rGpaMIdtog-20250910-124040.png" size="60" width="774" height="946" position="center" darkWidth="774" darkHeight="946" showCaption="false"}
:::
::::

:::ExpandableHeading
### Update a document

Updates a document using JSON, a data structure, or update operators.

| **Field**                  | **Description**                                                                                                                                                                                                          |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Connection**             | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                                                                                              |
| **Database**               | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string.                                                                            |
| **Collection**             | Enter the MongoDB collection name.                                                                                                                                                                                       |
| **Document search method** | Select document search method:<br />- Enter Object ID<br />- Search by query                                                                                                                                             |
| **Object ID**              | Enter Object ID.                                                                                                                                                                                                         |
| **Query**                  | Enter a query to specify the search.                                                                                                                                                                                     |
| **Update input method**    | Select document search method:<br />- Data structure<br />- JSON string<br />- Update operators                                                                                                                          |
| **Data structure**         | Create a data structure or choose the existing one. Make sure to follow the[ Mongo DB Type Representations](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/#type-representations) for certain data. |
| **JSON string**            | Enter a JSON string with the data you want to add to the document.                                                                                                                                                       |
| **Update operators**       | Use [MongoDB update operators](https://www.mongodb.com/docs/manual/reference/mql/update/#std-label-update-operators) for particular updates in the documents.                                                            |
:::

:::ExpandableHeading
### Delete a document

Deletes a document using an Object ID or a query.

| **Field**                  | **Description**                                                                                                                               |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connection**             | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                   |
| **Database**               | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string. |
| **Collection**             | Enter the MongoDB collection name.                                                                                                            |
| **Document search method** | Select document search method:<br />- Enter Object ID<br />- Search by query                                                                  |
| **Object ID**              | Enter Object ID.                                                                                                                              |
| **Query**                  | Enter a query to specify the search.                                                                                                          |
:::

## Multiple Documents&#x20;

::::ExpandableHeading
### Bulk create documents (advanced)

Creates multiple documents using JSON or a data structure. This module has built-in aggregation.

| **Field**                                      | **Description**                                                                                                                                                                                                          |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Source Module**                              | Select the module whose output you want to aggregate.                                                                                                                                                                    |
| **Connection**                                 | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                                                                                              |
| **Database**                                   | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string.                                                                            |
| **Collection**                                 | Enter the MongoDB collection name.                                                                                                                                                                                       |
| **Document input method**                      | Select document creation method:<br />- Data structure<br />- JSON string                                                                                                                                                |
| **Data structure**                             | Create a data structure or choose the existing one. Make sure to follow the[ Mongo DB Type Representations](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/#type-representations) for certain data. |
| **JSON string**                                | Enter a JSON string with the data you want to add to the document.                                                                                                                                                       |
| **Group by**                                   | Use this field in case you need to create documents in more than one **Collection** within one execution. Map the **Database** and **Collection** in this field.                                                         |
| **Stop processing after an empty aggregation** | When selected, Make stops when there are no results.                                                                                                                                                                     |

:::ExpandableHeading{isOpen="true"}
**Example&#x20;**

You can use **MongoDB > Bulk create documents (advanced)** as an aggregator. For example, when you pull the data from th&#x65;**&#x20;Google Sheets > Watch New Rows** module and want to create multiple documents in MongoDB with this data (e.g., full name, age, and city). You can define the data structure and map the values from the **Google** **Sheets** to the **MongoDB&#x20;**&#x6D;odule in the corresponding fields:

![](https://api.archbee.com/api/optimize/oAyFj2GHlBeBVWF5OAir2/v73nF-54QFBH2EIKM4XzB-20250925-151927.png)

Several documents will be created in your MongoDB database:

::Image[]{src="https://api.archbee.com/api/optimize/oAyFj2GHlBeBVWF5OAir2/78D0DxWTm-U8lZ1XXXgUd-20250912-080225.png" size="60" width="1182" height="1094" position="center" darkWidth="1182" darkHeight="1094" showCaption="false"}
:::
::::

:::ExpandableHeading
### Bulk update documents (advanced)

Updates multiple documents using JSON, a data structure, or update operators. This module has built-in aggregation.

| **Field**                                      | **Description**                                                                                                                                                                                                          |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Source Module**                              | Select the module whose output you want to aggregate.                                                                                                                                                                    |
| **Connection**                                 | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                                                                                              |
| **Database**                                   | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string.                                                                            |
| **Collection**                                 | Enter the MongoDB collection name.                                                                                                                                                                                       |
| **Create if not found**                        | Select whether a new document shall be created automatically if no matching document is found.                                                                                                                           |
| **Document search method**                     | Select document search method:<br />- Enter Object ID<br />- Search by query                                                                                                                                             |
| **Object ID**                                  | Enter Object ID.                                                                                                                                                                                                         |
| **Query**                                      | Enter a query to specify the search.                                                                                                                                                                                     |
| **Update input method**                        | Select document search method:<br />- Data structure<br />- JSON string<br />- Update operators                                                                                                                          |
| **Data structure**                             | Create a data structure or choose the existing one. Make sure to follow the[ Mongo DB Type Representations](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/#type-representations) for certain data. |
| **JSON string**                                | Enter a JSON string with the data you want to add to the document.                                                                                                                                                       |
| **Update operators**                           | Use [MongoDB update operators](https://www.mongodb.com/docs/manual/reference/mql/update/#std-label-update-operators) for particular updates in the documents.                                                            |
| **Group by**                                   | Use this field in case you need to create documents in more than one **Collection** within one execution. Map the **Database** and **Collection** in this field.                                                         |
| **Stop processing after an empty aggregation** | When selected, Make stops when there are no results.                                                                                                                                                                     |
:::

:::ExpandableHeading
### Bulk delete documents (advanced)

Deletes multiple documents by their Object IDs or a query. This module has built-in aggregation.

| **Field**                                      | **Description**                                                                                                                                                  |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Source Module**                              | Select the app module you are using to aggregate the fields you need.                                                                                            |
| **Connection**                                 | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                                      |
| **Database**                                   | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string.                    |
| **Collection**                                 | Enter the MongoDB collection name.                                                                                                                               |
| **Document search method**                     | Select document search method:<br />- Enter Object ID<br />- Search by query                                                                                     |
| **Object ID**                                  | Enter Object ID.                                                                                                                                                 |
| **Query**                                      | Enter a query to specify the search.                                                                                                                             |
| **Group by**                                   | Use this field in case you need to create documents in more than one **Collection** within one execution. Map the **Database** and **Collection** in this field. |
| **Stop processing after an empty aggregation** | When selected, Make stops when there are no results.                                                                                                             |
:::

## Queries

::::ExpandableHeading
### Search documents with a query

Returns all documents matching a query.

| **Field**                  | **Description**                                                                 |
| -------------------------- | ------------------------------------------------------------------------------- |
| **Connection**             | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).     |
| **Database**               | Enter the MongoDB database name where the collection is stored.                 |
| **Collection**             | Enter the MongoDB collection name.                                              |
| **Document search method** | Select document search method:<br />- Search by query                           |
| **Object ID**              | Enter Object ID.                                                                |
| **Query**                  | Enter a query to specify the search.                                            |
| **Sort**                   | Define the order in which documents should be returned.                         |
| **Projection**             | Specify which fields to include or exclude from the query result.               |
| **Limit**                  | Set the maximum number of results Make will return during one execution cycle.  |

:::ExpandableHeading{isOpen="true"}
**Example&#x20;**

A simplified example could be when you have a database in MongoDB with the documents containing full name, age, and city. To find people from Madrid, you can use the `{"city":"Madrid"}` query:

::Image[]{src="https://api.archbee.com/api/optimize/oAyFj2GHlBeBVWF5OAir2/W21HIhulHm89PoPepLZbJ-20250929-084354.png" size="60" width="1042" height="1370" position="center" showCaption="false"}

In the output, you'll get all the results that match the query. You can further use this data in any other relevant module of your scenario.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/oAyFj2GHlBeBVWF5OAir2/1UZGDJh47IYrpXj9KDP6m-20250912-092557.png" size="40" width="656" height="1356" position="center" darkWidth="656" darkHeight="1356" showCaption="false"}
:::
::::

:::ExpandableHeading
### Update documents with a query

Updates all the documents matching a query using JSON, a data structure, or update operators.&#x20;

| **Field**                  | **Description**                                                                                                                                                                                                          |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Connection**             | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                                                                                              |
| **Database**               | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string.                                                                            |
| **Collection**             | Enter the MongoDB collection name.                                                                                                                                                                                       |
| **Document search method** | Select document search method:<br />- Search by query                                                                                                                                                                    |
| **Query**                  | Enter a query to specify the search.                                                                                                                                                                                     |
| **Update input method**    | Select document search method:<br />- Data structure<br />- JSON string<br />- Update operators                                                                                                                          |
| **Data structure**         | Create a data structure or choose the existing one. Make sure to follow the[ Mongo DB Type Representations](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/#type-representations) for certain data. |
| **JSON string**            | Enter a JSON string with the data you want to add to the document.                                                                                                                                                       |
| **Update operators**       | Use [MongoDB update operators](https://www.mongodb.com/docs/manual/reference/mql/update/#std-label-update-operators) for particular updates in the documents.                                                            |
:::

:::ExpandableHeading
### Delete documents with a query

Deletes all documents matching a query.&#x20;

| **Field**                  | **Description**                                                                                                                               |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connection**             | [Create a connection to your MongoDB account](docId:0TDO8R2aK8ijDp9No472X).                                                                   |
| **Database**               | Enter the MongoDB database name where the collection is stored, or leave it blank if you defined a default database in the connection string. |
| **Collection**             | Enter the MongoDB collection name.                                                                                                            |
| **Document search method** | Select document search method:<br />- Search by query                                                                                         |
| **Query**                  | Enter a query to specify the search.                                                                                                          |
:::

# MongoDB resources

- [MongoDB API documentation](https://www.mongodb.com/docs/)
- [MongoDB Get Started Guides](https://www.mongodb.com/docs/guides/)

