UnhandledPromiseRejectionWarning: MongooseError: Operation `products.find()` buffering timed out after 10000ms




UnhandledPromiseRejectionWarning: MongooseError: Operation `products.find()` buffering timed out after 10000ms

Error on the following code.

    
    mongoose.connect(process.env.CONNECTION_URL, {
        useUnifiedTopologytrue,
        useNewUrlParsertrue,
        dbName:'ecommerce'
    }).then(() => {
        console.log("Database connect successfully!");
    }).catch((error=> {
        console.log(error);
    })



After solving the above code 

    
    mongoose.connect(process.env.CONNECTION_URL, {
        useUnifiedTopologytrue,
        useNewUrlParsertrue,
        bufferMaxEntries0// 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


Reactions

Post a Comment

0 Comments