-2

I am trying to connect MongoDB with node.js but whenever I try I am getting this error. (MongoDB is started).

[terminal]JavaScript code

I tried to restart MongoDB.

ibr55
  • 1
  • 1
  • 2
    Don't post code as images. Post it as text and use the proper code markdown formatting. – Wyck Nov 29 '22 at 09:52

1 Answers1

0

I found the solution, by replacing the URI from (mongodb://localhost:27017) to (mongodb://0.0.0.0:27017).

And it worked for me.

ibr55
  • 1
  • 1