connect to mongodb with username and password mongoose code example
Example: mongoose.connect
mongoose.connect('mongodb://localhost:27017/myapp', {useNewUrlParser: true});
mongoose.connect('mongodb://localhost:27017/myapp', {useNewUrlParser: true});