I know I\'m doing some very stupid and noobish, but I\'m hoping someone can help me set up a basic database connection to mongodb from node.js on a mac.
I\'ve instal
I also got stucked with same problem so I fixed it like this :
If you are running mongo and nodejs in docker container or in docker compose
so replace localhost with mongo (which is container name in docker in my case) something like this below in your nodejs mongo connection file.
var mongoURI = "mongodb://mongo:27017/";