skip to Main Content

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?

this is the error.

Yaml file

2

Answers


  1. replace mongo_db:27017 by 127.0.0.1:27017 or localhost:27017 and your docker compose have incorrect port binding for mongodb

    Login or Signup to reply.
  2. 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?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search