This repository consists a simple way to establish connection to MongoDB database using mongoose.
Type git clone NanduWasTaken/MongooseMongoDBConnection.git
into the terminal.
Go to MongoDB website and make a account and create your own database. Locate the MongoDB URI => Connect>Drivers (the uri will be different on yours) Now Replace the "Super Secret MongoDB URI Here" with your actual MongoDB URI
mongoose.connect('Super Secret MongoDB URI Here', {
useNewUrlParser: true,
useUnifiedTopology: true
});
Type node index.js
to your terminal.