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

# MongoDB

## Overview

Stigg's integration with MongoDB allows you to export your product catalog, customer, and subscription data directly to your MongoDB instance for custom reporting and analysis.

<Note>
  Stigg's native data export integrations are included in the Scale plan, and are also available as an optional add-on to the Growth plan. See Stigg's pricing for more details.
</Note>

<Card title="View the full entity schema" icon="sitemap" href="./schema">
  See every table and column exported to your destination, organized by entity group.
</Card>

## Setting up the integration

### Prerequisites

You'll need a MongoDB instance (self-hosted or MongoDB Atlas) with a database and a user that has read/write access to that database.

<Steps>
  <Step title="Locate your connection details">
    **Using the MongoDB CLI:** connect as an admin user and run:

    <CodeGroup>
      ```javascript Find host identifiers theme={null}
      db.adminCommand( { replSetGetStatus : 1 } ).members
      ```
    </CodeGroup>

    **Using MongoDB Atlas:** open your dashboard, go to the **Database** tab, click **Connect**, then **Drivers**. Copy the host identifier from the connection string — the part after the `@` symbol, e.g. `some-cluster.some-characters.mongodb.net`.
  </Step>

  <Step title="Create a writer user">
    **Using the MongoDB CLI:**

    <CodeGroup>
      ```javascript Create user theme={null}
      use admin
      db.createUser({
        user: "<username>",
        pwd: "<password>",
        roles: [ {role: "readWrite", db: "<database>"} ]
      })
      ```
    </CodeGroup>

    **Using MongoDB Atlas:** go to **Security > Database Access > Add New Database User**, select **Password** authentication, and grant the `readWrite@<database>` privilege. Leave the **Collection** field as `*`.
  </Step>

  <Step title="Allow network access">
    If your database enforces IP whitelisting, add Stigg's static IP to your allow list:

    | Region   | Static IP           |
    | -------- | ------------------- |
    | US Cloud | `35.192.85.117/32`  |
    | EU Cloud | `104.199.49.149/32` |

    For private or self-hosted deployments, [contact Stigg support](mailto:support@stigg.io) for the appropriate IP.

    **Using the Atlas CLI:**

    <CodeGroup>
      ```bash Add IP to access list theme={null}
      atlas accessLists create "<static_ip_address>/32" --comment "data sharing service static IP"
      ```
    </CodeGroup>

    **Using the Atlas dashboard:** go to **Security > Network Access > Add IP Address**, enter the static IP, and add an optional comment.
  </Step>

  <Step title="Connect Stigg with MongoDB">
    In [Stigg](https://app.stigg.io/), navigate to **Integrations > Apps > MongoDB**.

    Enter the following information in the connection form:

    | Field    | Description                                                                                |
    | -------- | ------------------------------------------------------------------------------------------ |
    | Host     | The MongoDB server hostname. For Atlas, use the node hostname from your connection string. |
    | Port     | The port MongoDB listens on. Defaults to `27017`. Not required for MongoDB Atlas.          |
    | Database | The name of the target database                                                            |
    | Username | The MongoDB user Stigg will authenticate as                                                |
    | Password | The password for the MongoDB user                                                          |

    Click **Test & connect**.
  </Step>

  <Step title="Select entities to export">
    After entering your connection details, expand the **Entities to export** section to choose which entity groups to include in the sync. All groups are selected by default.

    See [Exported entities](./overview#exported-entities) for a description of each group.
  </Step>
</Steps>


## Related topics

- [Exported entities](/documentation/importing-and-exporting-data/export/overview.md#exported-entities)
- [Sync process, schedule, manual sync, and sync history](/documentation/importing-and-exporting-data/export/overview.md#sync-process)
