MongoDB setup under Docker and testing Notes against MongoDB

In Chapter 7, Data Storage and Retrieval, we developed MongoDB support for Notes, and since then we've focused on Sequelize. To make up for that slight, let's make sure we at least test our MongoDB support. Testing on MongoDB would simply require defining a container for the MongoDB database and a little bit of configuration.

Visit https://hub.docker.com/_/mongo/ for the official MongoDB container. You'll be able to retrofit this to allow deploying the Notes application running on MongoDB.

Add this to test-compose/docker-compose.yml:

db-notes-mongo-test:  image: mongo:3.6-jessie  container_name: db-notes-mongo-test  networks:    - frontnet-test  volumes:    - ./db-notes-mongo:/data/db

That's ...

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.