dFlow
Databases

MongoDB

Run MongoDB on dFlow: document database, MONGO reference variables, and multi-port behavior when you Expose.

MongoDB stores documents (JSON-like) in collections. It fits evolving schemas, nested objects, and workloads where a rigid SQL schema is awkward.

Overview of the database model in dFlow: Databases overview.

MongoDB database service in the dashboard with deploy or status on Overview.

When to choose MongoDB

Choose MongoDB when a document model matches your product, or your stack already uses official MongoDB drivers and patterns. For relational reporting and strict multi-table constraints, Postgres is often simpler.


Create and deploy

  1. Applications → Environment → Add New → Add service → Database → MongoDB.
  2. Create Service → Deploy.
  3. Wait until provisioning succeeds.

Connection details on Overview

Internal credentials include:

  • A mongodb://… connection URL.
  • Username, password, host, port, and database name for clients that need discrete fields.

Use the internal URL for applications in the same environment.

MongoDB service Overview with internal connection URL, user, password, host, and port.

Variables → { } menu. Example:

{{ my-mongo.MONGO_URI }}
SuffixResolves to
_URIInternal connection URL
_NAMEDatabase from the URL path
_USERNAMEUser
_PASSWORDPassword
_HOSTInternal host
_PORTInternal port
_PUBLIC_HOSTAfter Expose
_PUBLIC_PORTAfter Expose
_PUBLIC_URIAfter Expose

Internet access (Expose)

MongoDB differs from Postgres or MySQL: Expose may provision more than one public port for the protocols MongoDB uses. You still click Expose once; Overview shows the primary public URL/host/port information most clients need.

Keep using internal URLs for apps running on dFlow. Use Expose when an external client must connect (backup tools, local shells, partners).

Unexpose before Stop if the database was exposed.


Day-to-day actions

Restart, Stop, and Expose / Unexpose follow the same dashboard rules as other databases, including Unexpose before Stop when public, and Deploy hidden after the first successful provision. See Databases overview.


Troubleshooting

Database troubleshooting


On this page