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