Browse docs
Cloud docs
Connecting to DocumentDB on Layerbase Cloud
DocumentDB gives MongoDB-compatible APIs backed by PostgreSQL, so many document workloads can use MongoDB tooling without MongoDB server licensing.
Best for: MongoDB-compatible apps, open-source document workloads, and teams standardizing storage around PostgreSQL.
Open your database in the dashboard
Go to /cloud, click the database you just created, and the connection panel shows the host, port, username, password, and a ready-to-paste connection string for the engine.
Use the generated URI from Quick Connect, preserving authSource=admin and tls=true.
If a password leaks, the database owner can replace it with Rotate password under Connection parameters in the Connect dialog, on PostgreSQL, MySQL, MariaDB, Redis, and Valkey. The old password stops working at once, the connection string and any HTTP API token change with it, and connections that are already open stay connected. Update every app and environment variable that holds the old value. Branches keep their own passwords.
You can also download the whole set instead of copying values one at a time: the Connect dialog offers a Download .env file, ready to drop into a project under the environment variable your engine's clients expect, and a Download .txt with the labeled parameters. Both files contain the password in plain text, so keep them out of version control.
TLS is required, on by default
Add tls=true to the MongoDB URI.
MongoDB-compatible wire protocol over TLS on port 27017
Use any standard client
DocumentDB works with the normal client family for that engine. Start with the dashboard snippet, then move the same URL and credentials into your app environment.
If your client has separate direct, pooled, TLS, or HTTP options, prefer the exact variant shown in Quick Connect.
mongosh "mongodb://layerbase:password@your-host.cloud.layerbase.dev:27017/app?authSource=admin&tls=true"DocumentDB notes
- Standalone DocumentDB 1.0 is distinct from Amazon DocumentDB and FerretDB. Cloud availability is still being qualified.
- Test aggregation-heavy and index-heavy workloads before migrating production traffic.