1const mongoose = require('mongoose');
2mongoose.connect('mongodb://localhost:27017/test', {useNewUrlParser: true, useUnifiedTopology: true});
3
1
2//connect with mongodb
3mongoose.connect('mongodb://localhost:27017/your_db_name', {useNewUrlParser: true});
4//you can also specify with user and pass
5mongoose.connect('mongodb://username:password@host:port/database?options...', {useNewUrlParser: true});
6//or goto docs https://mongoosejs.com/docs/connections.html