mongoose .connect("mongodb://localhost:27017/blogDB", { useNewUrlParser: true, useUnifiedTopology: true }) .then(() => console.log("Database connected!")) .catch(err => console.log(err));