mongoose.connect("mongodb://localhost:27017/YourDB", { useNewUrlParser: true });
mongoose
.connect(DB, {
useNewUrlParser: true,
useCreateIndex: true,
useUnifiedTopology: true,
useFindAndModify: false,
})
const mongoose = require('mongoose');
mongoose
.connect(connection_string, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false,
})
.then((con) => {
console.log("connected to db");
});