> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useparagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MongoDB Integration

> Connect your MongoDB database to Paragon.

## 1. Get MongoDB Details & Whitelist Paragon IP Addresses

You can get your database credentials from whoever set up the database. You'll also need to get them to whitelist the Paragon IP addresses:

* `18.205.92.162`

* `54.235.127.238`

* `18.215.215.164`

* `34.225.59.94`

* `44.210.155.28`

* `52.45.12.206`

## 2. Add MongoDB to Paragon

To add MongoDB to Paragon, click the "+" button in the workflow canvas and choose the MongoDB from the sidebar. Under **Connect to a MongoDB account**, choose "Add new account for MongoDB" and enter your database credentials. We recommend setting up separate accounts for read and write access to make it harder to accidentally cause unwanted changes to your database.

<Frame caption="">
  <img src="https://mintcdn.com/paragon/XNDe-bFT_2yOxy1A/assets/Connecting%20MongoDB%20to%20Paragon.png?fit=max&auto=format&n=XNDe-bFT_2yOxy1A&q=85&s=f07300596a78d41de13ca6b44b0afc64" width="1598" height="1718" data-path="assets/Connecting MongoDB to Paragon.png" />
</Frame>

## 3. Query MongoDB

Once your MySQL database is connected, you can add steps to perform the following actions:

* Write MongoDB Query

* Find Documents

* Find Document by ID

* Create Document

* Update Documents

* Update Document by ID

* Delete Documents

* Delete Document by ID

When writing MongoDB queries, you can reference data from previous steps by typing `{{` to invoke the variable menu.

## Event Trigger

With the MongoDB trigger, Paragon checks for new data from your trigger every minute in order to start your workflow. Your workflow runs for each record meeting the trigger criteria. For example, five new records in your database with a "new record created" action would run your workflow five separate times, each with information from the corresponding record.

The MongoDB trigger provides the following trigger options:

* **New record created**

* **Record updated**

<Info>
  You'll need to include a **date column** in your MongoDB database for this
  event trigger to work properly.
</Info>

#### Ordering Records

Paragon displays new and updated records ordered by date in your workflow, with the newest records appearing first. You should order your records by a date column, such as `date_created` or `lastSeen`, to properly determine new or updated records.

<Frame caption="">
  <img src="https://mintcdn.com/paragon/7RZyQGncIlY8Xl4A/assets/Ordering%20by%20last%20seen%20in%20Paragon.gif?s=1f0ad5fbd306ff2cf087ce1ea2fbc25b" width="536" height="471" data-path="assets/Ordering by last seen in Paragon.gif" />
</Frame>

#### Testing Event-based Triggers

You can test your workflow on different records using the **Debugging Menu**. Click the "use a different record as test data" dropdown menu for a list of available records.

<Frame caption="">
  <img src="https://mintcdn.com/paragon/867oBBVpxd2C3zc4/assets/Using%20different%20records%20as%20test%20data.gif?s=34f751362a69c5f3391eaaf39376d3f1" width="600" height="526" data-path="assets/Using different records as test data.gif" />
</Frame>
