How to Setup MongoDB with Docker Compose + Use Mongo Shell ( Mongo DB + Docker + Mongo CLI / Shell )

Опубликовано: 28 Сентябрь 2024
на канале: Jason Cheung
7,658
44

How to setup MongoDB with Docker Compose. Quick and easy tutorial for setting this database up with docker. Also shows how to use the Mongo Shell or CLI to modify data.

Reminder to ensure docker is running in the background.

Code: https://github.com/Jasoncheung94/yout...

Main folder: https://github.com/Jasoncheung94/yout...

Commands to start:
docker-compose up -d

Commands to stop:
docker-compose down

Commands to run CLI via container:
docker exec -it mongodb bash

mongo --username root --password password --authenticationDatabase admin

Timeline:
0:00 - Create Project and Compose file

🎵 Track Info
––––––––––––––––––––––––––––––
Cali by Wataboi   / wataboi  
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: https://bit.ly/wataboi-cali
Music promoted by Audio Library    • Cali – Wataboi (No Copyright Music)  
––––––––––––––––––––––––––––––