mongodbdockerstudio3t

How to connect MongoDB docker by Studio 3T?


I am using docker image https://hub.docker.com/_/mongo/ (Latest MongoDB version)

I run command

docker run --name some-mongo -d mongo

Then I install Studio 3T I enter connection information like this

enter image description here

but I can't connect. What is correct connection must declare in Studio 3T in this case? How to connect MongoDB instance (docker) by Studio 3T?


Solution

  • You need to export the port you want to use in your docker command. e.g.

    docker run -p 127.0.0.1:27017:27017 --name some-mongo -d mongo
    

    This opens the port of the container on your host machine.