Await Mongoose.connect Code Example
Example 1: async await mongoose connection
(async () => { try { await mongoose.connect(dbURI, dbOptions) } catch (err) { console.log('error: ' + err) } })()
Example 2: mongoose.connect
mongoose.connect('mongodb://localhost:27017/myapp', {useNewUrlParser: true});
Comments
Post a Comment