Skip to content

Instantly share code, notes, and snippets.

@httpJunkie
Last active April 4, 2020 09:05
Show Gist options
  • Select an option

  • Save httpJunkie/cd20a8d36ce89f3b6d1cf7a0c0bb8212 to your computer and use it in GitHub Desktop.

Select an option

Save httpJunkie/cd20a8d36ce89f3b6d1cf7a0c0bb8212 to your computer and use it in GitHub Desktop.

Revisions

  1. httpJunkie revised this gist Apr 4, 2020. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -16,5 +16,16 @@ latest version as of this writing is 4.2.5 which we would name `mongo425` like s

    ## Connecting to Mongo Shell

    `docker exec -it mongodb bash`
    `docker exec -it mongo425 bash`

    then run:

    ```
    > mongo
    > show dbs
    > use task-management
    ```

    This will first show us the current databases and then we create a new database called task-management
  2. httpJunkie revised this gist Apr 4, 2020. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,9 @@ docker pull mongo:X.X.X

    latest version as of this writing is 4.2.5 which we would name `mongo425` like so:

    `docker run -d -p 27017-27019:27017-27019 --name mongo425 mongo:4.2.5`
    `docker run -d -p 27017-27019:27017-27019 --name mongo425 mongo:4.2.5`

    ## Connecting to Mongo Shell

    `docker exec -it mongodb bash`

  3. httpJunkie created this gist Apr 4, 2020.
    15 changes: 15 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # Run Mongo using Docker

    This guide will get you up and running with Mongo

    ## Download latest Image

    docker pull mongo:X.X.X

    ## Installing and Running Mongo in Detached Mode (In Background and able to connect from server)

    `docker run -d -p 27017-27019:27017-27019 --name mongoXXX mongo:X.X.X`

    latest version as of this writing is 4.2.5 which we would name `mongo425` like so:

    `docker run -d -p 27017-27019:27017-27019 --name mongo425 mongo:4.2.5`