MongoDB

MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL, MongoDB uses JSON-like documents with schema.

Add a MongoDB database to your application

To add a dedicated MongoDB instance to your existing application, simply add these lines to your configuration file:

.qovery.yml
application:
...
databases:
- type: mongodb
version: 4.2
name: my-mongodb
  • name: select a name for your database
  • version: choose the version of the database
  • type: the database engine (mongodb in this case)

Supported versions

Here are the MongoDB versions supported by Qovery.

VersionSupported
4.2Yes
4.0Yes
3.6Yes

Qovery does not support a new version of MongoDB yet? Contact us

Get access to your MongoDB database

To get the connection information of your database, you can use the CLI:

qovery application env list -c
OUTPUT
$ qovery application env list -c
SCOPE | KEY | VALUE
--------------+---------------------------------------------------------------+-----------
BUILT_IN | QOVERY_BRANCH_NAME | master
BUILT_IN | QOVERY_IS_PRODUCTION | true
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_NAME | my-mongodb
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_TYPE | mongodb
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_VERSION | 4.2
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_CONNECTION_URI | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_CONNECTION_URI_WITHOUT_CREDENTIALS | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_HOST | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_FQDN | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_PORT | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_USERNAME | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_PASSWORD | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_MONGODB_DATABASE | mongodb

In the output, you get all data you need to use the database. Those environment variables are available in the runtime of your application.

Show MongoDB database status

To know more about your database status, run:

qovery status -c
OUTPUT
DATABASE NAME | STATUS | TYPE | VERSION | ENDPOINT | PORT | USERNAME | PASSWORD | APPLICATIONS
----------------+---------+---------+---------+----------+----------+----------+----------+-----------------
my-mongo | running | mongodb | 4.2 | <hidden> | <hidden> | <hidden> | <hidden> | simple-example

Delete your MongoDB database

To delete a database, you have to:

  • Remove it from the configuration file, commit and push.
  • Delete it manually (for security purpose) through the Qovery web interface.

MongoDB backup

Daily backups for your MongoDB database are automatically done for Production environments.