Mongo

1. mongo docker image

Start the Database

1
docker run --name mymongo -d mongo:<label> --auth

Add the Initial Admin User

1
2
3
4
5
6
7
8
9
10
11
12
$ docker exec -it mymongo mongo admin
connecting to: admin
> db.createUser({ user: 'jsmith', pwd: 'some-initial-password', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] });
Successfully added user: {
"user" : "jsmith",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
}
]
}

2. mongo backup and restore