- Databases
- MongoDB
MongoDB
Lade officially supports deploying MongoDB databases.
Supported Versions
The following MongoDB versions are supported and receive security updates:
- 8.0
- 7.0
- 6.0
- 5.0
Provisioning MongoDB
A MongoDB addon can be provisioned with the CLI:
$ lade addons create mongo --name mydb
You will be prompted to select an available plan, region, and version.
Attaching to Your App
Your MongoDB addon can be attached to your app with the CLI:
$ lade addons attach mydb --app myapp
When your addon is attached, the DATABASE_URL
and MONGO_URL
environment variables will be added to your app.
You can confirm these environment variables were added to your app with the lade env list
command.
Accessing Your Database
To access your database remotely, you will need to enable public access on your addon. You can view settings with the lade addons show
command. The addon URI will follow the format:
mongodb://<user>:<password>@<host>:<port>/<dbname>?ssl=true
You can access your remote database with the mongo
command:
$ mongo <addon URI>
MongoDB shell version v8.0
connecting to: mongodb://user:password@host:port/dbname?ssl=true
MongoDB server version: 8.0
>