mongoose connect to url of atals

Solutions on MaxInterview for mongoose connect to url of atals by the best coders in the world

showing results for - "mongoose connect to url of atals"
Mehdi
08 Jun 2017
1try {
2  mongoose.connect(MONGODB_URI || 'mongodb://localhost/YOUR_DB_NAME', {
3      useNewUrlParser: true,
4      useUnifiedTopology: true
5    }, () =>
6    console.log("connected"));
7} catch (error) {
8  console.log("could not connect");
9}