When you connect you can pick up the error in the callback:
mongoose.connect('mongodb://localhost/dbname', function(err) {
if (err) throw err;
});
More Related Contents:
- Updating a Nested Array with MongoDB
- Mongoose and multiple database in single node.js project
- MongoDB, remove object from array
- How do I update/upsert a document in Mongoose?
- Mongoose find/update subdocument
- Mongoose, Select a specific field with find
- How to sort in mongoose?
- Mongoose difference between .save() and using update()
- Bulk upsert in MongoDB using mongoose
- UnhandledPromiseRejectionWarning: MongooseServerSelectionError
- Mongoose subdocuments vs nested schema
- Why is an _id with ObjectID added to when using MongoDB’s $push to add new object to an array?
- How to set _id to db document in Mongoose?
- What is a TransientTransactionError in Mongoose (or MongoDB)?
- Mongoose.js: Find user by username LIKE value
- Server Discovery And Monitoring engine is deprecated
- Mongoose Not Creating Indexes
- MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
- Node.js mongodb driver async/await queries
- Find after populate mongoose
- What is the difference between id and _id in mongoose?
- JavaScript NoSQL Injection prevention in MongoDB
- Group by Date with Local Time Zone in MongoDB
- MongooseError: Model.findOne() no longer accepts a callback at Function
- Mongoose find() not returning result
- How to search in array of object in mongodb
- Using Multiple Mongodb Databases with Meteor.js
- Trying to hash a password using bcrypt inside an async function
- Mongoose schema within schema
- Multiple schema references in single schema array – mongoose