Error on the following code.
mongoose.connect(process.env.CONNECTION_URL, {
useUnifiedTopology: true,
useNewUrlParser: true,
dbName:'ecommerce'
}).then(() => {
console.log("Database connect successfully!");
}).catch((error) => {
console.log(error);
})
After solving the above code
mongoose.connect(process.env.CONNECTION_URL, {
useUnifiedTopology: true,
useNewUrlParser: true,
bufferMaxEntries: 0, // MongoDB driver buffering
dbName:'ecommerce'
}).then(() => {
console.log("Database connect successfully!");
}).catch((error) => {
console.log(error);
})
Use bufferMaxEntries: 0 to remove the UnhandledPromiseRejectionWarning: MongooseError: Operation `products.find()` buffering timed out after 10000ms
0 Comments
If you have any question please ask?