Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MongoDB in Docker

Start the Docker container

docker run -it -d --name mymongo mongo:latest

Connect to the Docker container

docker exec -it mymongo bash

Inside the container start the client and send commands

mongosh
db.students.insertOne({"name": "foo", "grades" : { "A" : 1, "B" : 2, "c" : 3, "d" : 4 }});