https://github.com/gf3/docker-mongosh
Docker image for mongosh
https://github.com/gf3/docker-mongosh
docker mongo mongodb mongoshell shell
Last synced: about 1 year ago
JSON representation
Docker image for mongosh
- Host: GitHub
- URL: https://github.com/gf3/docker-mongosh
- Owner: gf3
- Created: 2020-11-26T07:02:08.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-26T07:23:59.000Z (over 5 years ago)
- Last Synced: 2025-04-10T16:25:27.622Z (about 1 year ago)
- Topics: docker, mongo, mongodb, mongoshell, shell
- Language: Dockerfile
- Homepage:
- Size: 1000 Bytes
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker mongosh
A docker image for the [MongoDB Shell](https://github.com/mongodb-js/mongosh).
> The MongoDB Shell, mongosh, is a fully functional JavaScript environment for
> interacting with MongoDB deployments. You can use the MongoDB Shell to test
> queries and operations directly with your database.
**Note:** Built on mongosh 0.5.2
## Using
Pull the docker image.
```sh
docker pull gianni/mongosh:latest
```
Alias it in your shell.
Bash:
```sh
alias mongosh='docker run -it --rm --network host -v $(pwd):/root mongosh:latest'
```
Fish:
```fish
alias mongosh 'docker run -it --rm --network host -v (pwd):/root mongosh:latest'
```
And finally, run it as you typically would.
```sh
mongosh "mongodb://mongo-host:27017/database"
...
.load ./myFile.js
```
## Building
```sh
git clone git@github.com:gf3/docker-mongosh.git
cd docker-mongosh
docker build -t mongosh:latest .
docker run -it --rm mongosh:latest
```