module.exports = Mongoose.connect(process.env.DB_URI, { options: { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, }, }); code example
Example: mongoose connection node
mongoose.connect('mongodb://localhost/myapp', { useNewUrlParser: true, useUnifiedTopology: true });