Database service

MongoDB Server

The MongoDB Server integration spins up and manages a local mongod process. It owns the process lifecycle and exposes server-level operations — listing, creating, and dropping databases — for development and long-running deployments.

MongoDB Server is one of the Database service integrations. It handles its own webhook route:

POST/mongod/webhook
Spawn & manage a local mongod process

What it does

On DEPLOYMENT_CREATED the service launches a mongod process, manages its lifecycle, and reports the server connection string back to Dreambase. Where the MongoDB integration attaches a database to a server, this integration is the server.

Serverless limitations

Because this route spawns and manages a local process, it's meant for local or long-running deployments. On serverless hosts there is no persistent machine — use the shared-server MongoDB route instead, or set ENABLE_LOCAL_PROCESSES on a host that supports it.

Inputs

InputRequiredDescription
portoptionalPort for mongod to listen on. Auto-assigned from 27018 if not provided.
dataDiroptionalFilesystem path for mongod data files. Auto-created under /tmp if not provided.

Outputs

  • url — the MongoDB server connection string (e.g. mongodb://127.0.0.1:27018).
  • port — the port mongod is listening on.
  • dataDir — filesystem path where mongod stores its data files.

Functions

Server-level operations, callable via a FUNCTION_CALL event:

  • listDatabases — list all databases on the server.
  • createDatabase — create a new database on the server.
  • dropDatabase — drop a database from the server.
  • getServerStatus — get the current status and diagnostics of the mongod server.

Events it handles

  • WEBHOOK_CHALLENGE — verify the webhook endpoint.
  • HEALTH_CHECK — confirm the server is reachable.
  • DEPLOYMENT_CREATED — start mongod and return its connection details.
  • DEPLOYMENT_DELETED — stop the process and tear it down.
  • DOWNLOAD_STARTED — signal that a build/download has begun.
  • FUNCTION_CALL — run a named server function.