Skip to content

Commit

Permalink
add mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Dec 7, 2022
1 parent a5ba7ba commit 79b6171
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/docker.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"perl.md",
"networking.md",
"postgresql.md",
"mongodb.md",
"deploy.md",
"appendix.md",
"kubernetes.md",
Expand Down
24 changes: 24 additions & 0 deletions docker/mongodb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Docker
{id: docker}

## MongoDB in Docker
{id: 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 }});
```

0 comments on commit 79b6171

Please sign in to comment.