I am studying the MEAN stack by using this tutorial. But the tutorial connects to a remote mongodb installation. I have MongoDB running in the CentOS7 localhost.
How do I alter the mongoose connect line in server.js from the tutorial link above to connect to a localhost database instead of a remote database?
Here is the current line from
I'm fairly new at Mongo to, but I know how to connect to a local db. Basically I had to do the following:
mongod --dbpath [YOUR_DB_PATH]
mongodbdb instance looking for connections on default port. So you can change that line for this:
Again, this is really basic and it is creating a mongo DB connection with all default options. So this will keep you rolling, but you may need to dig a bit more for custom options.
Hope this helps