Skip to content

MongoDB and MongoExpress

Ecoact CDA team uses MongoDB as its document oriented database, alongside with mongo-express to have admin access and handling of data.

Contrary to relational database, NoSQL systems can handle non tabular data. For a brief overview of the differences, see this.
One kind of NoSQL databases are ,document databases, that store structured document in format such as XML or JSON.
MongoDB is one such document database.

MongoExpress is a web-based MongoDB admin interface allowing you to access your documents collections through your browser. It is the MongoDB equivalent of pgAdmin.

Setting up the mongo-db stack

All relevant information can be found in the docker-compose.mongo.yml file (here).

Production mode

Remember that you need to setup traefik when in production before launching this stack. Go read the traefik page if not already done.

To start the stack in production, you can make use of the Makefile provided in the repo (make help) to list available commands.

you will need to create a .env file and setting

  • mongoexpress_url entry to the DNS address you created in order to reach the mongo-express interface.
  • mongo_username: the user authorized to connect to the database
  • mongo_password: the password associated with mongo_username

You can then safely launch

make mongo-launch

mongo-express will be accessible at mongoexpress_url