Skip to content

MongoDB

MongoDB is an alternative storage backend for Console — a drop-in replacement for the default SQLite / PostgreSQL SQL backends. Switching is a configuration change only: no code change, no schema migration. The repository interfaces are identical across backends, so the use-case and HTTP layers are unaware of which one is in use.

API compatibility

The MongoDB backend is fully API-compatible with the SQL backends. Everything available through the Console UI or REST API behaves the same on either backend. Data does not migrate automatically between backends.

Selecting the backend

Set DB_PROVIDER=mongo (or db.provider: mongo in config.yml) and supply a DB_URL such as mongodb://user:pass@host:27017/?authSource=admin. See the Database overview for how DB_PROVIDER chooses among all backends.

Notes:

  • DB_POOL_MAX is honored only by the SQL backends. The MongoDB driver manages its own connection pool, configured through DB_URL options such as maxPoolSize. See MongoDB connection string options for the full list.

Source paths in this section

File paths and CI workflow references in the pages that follow (e.g., internal/usecase/nosqldb/mongo/, internal/app/repos.go, .github/workflows/api-test.yml) refer to the Console source repository, not to this docs repo.

Next steps