Skip to main content

MongoDB

Connect a MongoDB database to DashX. Once installed, you can sync its collections into Resources and read and write documents through the DashX API.

Prerequisites

Prerequisites

Before setting up the MongoDB integration, ensure you have:

  • An active DashX account
  • A running MongoDB deployment reachable from the internet
  • Credentials for a database user DashX can connect as

Prepare a database user

Create a dedicated user for DashX rather than reusing an application or admin account, and give it a role scoped to the single database you want to expose — read if you only intend to query, readWrite if DashX should also modify documents.

db.createUser({
user: "dashx",
pwd: "a-strong-password",
roles: [ { role: "read", db: "your_database" } ]
})

If you are using MongoDB Atlas, create the user under Database Access instead and assign it the same scoped role.

Allow network access

Your deployment must accept connections from DashX. On Atlas this means adding an entry under Network Access; on a self-hosted deployment it means adjusting the relevant firewall or security group rule.

Connect to DashX

  1. Log in to your DashX workspace
  2. Navigate to Settings > Integrations
  3. Click [+] to add a new integration and select MongoDB
  4. Choose the environments you want to enable it for
  5. Enter the configuration below and save

Configuration

FieldDescription
HostHostname of the MongoDB deployment.
PortPort the deployment listens on. MongoDB defaults to 27017.
UserThe database user DashX connects as.
PasswordPassword for that user.
Database NameThe database to connect to.

Sync your collections

With the integration installed, open Data > Overview and choose Sync Database to read the structure and turn collections into resources. See Resources for the full flow.

tip

MongoDB documents in the same collection can have differing shapes. Review the attributes DashX infers after syncing, and adjust them where the inferred type is not what you want.

Related: the Database Hub app.