enter image description here
i want to get this thunder client request result in MongoDB compass. but my MongoDb compass not shown thiss result? how to fix it?
enter image description here
i want to get this thunder client request result in MongoDB compass. but my MongoDb compass not shown thiss result? how to fix it?
2
Answers
replace mongo_db:27017 by 127.0.0.1:27017 or localhost:27017 and your docker compose have incorrect port binding for mongodb
You only use the hostname
mongo_db
when you connect to the container from another container on the Docker bridge network that docker-compose creates for you. On the bridge network you use the unmapped port number: 27017.When you connect from the host machine, you need to use
localhost
and the mapped port number.So you need to change your URI in Compass to
mongodb://localhost:2717/express_mongoosen
.There’s nothing wrong with mapping to port 2717 as such, so if that’s intentional, then keep using it. But it does look like it might be a typo and you meant to use 27017?