title: Connect node app running in docker to mongodb community instance running locally
body: <p>I have a node app running as a docker container, previously before I containerised the node app I accessed mongodb instance like this <code>mongodb://localhost:27017/&lt;dbname&gt;?authSource=admin&amp;directConnection=true</code>. I had tried the same but it failed hence tried this <code>mongodb://host.docker.internal:27017/&lt;dbname&gt;?authSource=admin&amp;directConnection=true</code> which is still failing with the error</p>
  <pre><code>Database error. error code: unknown, error message: Server selection timeout: No available servers. Topology: { Type: Single, Servers: [ { Address: localhost:27017, Type: Unknown, Error: Cannot assign requested address (os error 99) }, ] }
  </code></pre>