mongoose.connect(process.env.MONGODB_URI || 'mongodb://localhost/', { useNewUrlParser: true }); code example
Example: mongoose.connect(process.env.MONGODB_URI, { useNewUrlParser: true, useCreateIndex: true, });
mongoose.connect('mongodb://username:password@host:port/database?options...', {useNewUrlParser: true});