docker-compose build && docker-compose up -d
docker exec -it mongo mongo -u " --- (MONGO_ADMIN) --- " -p " --- (MONGO_ADMIN_PSWD) --- " --authenticationDatabase admin
use --- (MONGO_DB_NAME) ---
db.createUser({user: ' --- (MONGO_DB_USER) --- ', pwd: '---- (MONGO_DB_PSWD) ----', roles:[{role:'dbOwner', db:'--- (MONGO_DB_NAME) ---'}]})
db.test_collection.insert({ test: "test" })
Displaying all collections of our previously created db in order to make sure that our test collection was successfully created
show collections
exit
docker stop <api_contrainer_id>
docker-compose build && docker-compose up -d