If the answers below doesn't work for you, try this:
Found the solution in https://jquery.develop-bugs.com/article/10214076/How+to+connect+MongoDB+docker+by+Studio+3T%3F
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
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?
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.
You need to find the IP address where the Docker container is running. On Mac docker runs in the background inside a Linux VM that has its own IP. Thus localhost will not work.
To find the IP, run docker-machine env default and set this IP in the Server field.