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

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?