linnovate / meanio

meanio core module
MIT License
54 stars 73 forks source link

Mongoose Update to 5 or 6 #163

Open nidhinprathap opened 2 years ago

nidhinprathap commented 2 years ago

Hi, I have an application running on the old Mean stack. I wanted to upgrade the mongoose version to 5/6. The issue is once I upgrade I get the following error

MongooseError: Operationx.findOne()buffering timed out after 10000ms at Timeout.setTimeout (api/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:198:23)

not sure how to overcome this. I tried a couple of solutions mentioned in StackOverflow regarding the mongoose update, but nothing helps. If someone can just point out how can i get it fixed, it will be great

My gut feel is that its an issue with Promises and Callbacks for mongoose.connect() mongoose.connect() and mongoose.disconnect() now return a promise if no callback specified, or null otherwise. It does not return the mongoose singleton.