Mongodb is a document-oriented database that fits into the family of NOSQL databases. In this video we will spin up mongodb database using docker, we will learn how to use mongo shell to create a collections and write few rows. And we will also learn use mongo GUI web interface .
//Install Docker from https://www.docker.com/ (Windows/Mac or Linux)
//Run mongo db container
docker run -p 27017:27017 --name mdb mongo
//bash into the container and run mongo shell
docker exec -it mdb mongo
//create db and collection
use husseindb
db.employees.insertMany([
{
"name": "Hussein",
"eId": 1335,
"title" : "Engineer"
},
{
"name": "Ali",
"eId": 1334,
"title" : "Engineer"
},
{
"name": "Sam",
"eId": 1331,
"title" : "Developer"
},
{
"name": "Nasser",
"eId": 1340,
"title" : "Manager"
}
]
)
//optionally use a GUI mongo client
docker run -p 3000:3000 --name mclient mongoclient/mongoclient
Jump codes
0:00 Intro
2:00 Run mongo db container
5:50 Mongo shell
8:20 Create Database
9:10 Create Collections
11:00 InsertMany
12:40 Find
14:30 Mongo GUI
Support me on PayPal https://bit.ly/33ENps4
Become A Patron / hnasr
Stay Awesome!
Hussein