i am getting error on this topic
MongooseError: Operation people.insertOne()
buffering timed out after 10000ms
PLEASE FIX THIS
WHEN I OPEN MongoDB THEN I WILL CONNECT FROM Connecting with the MongoDB Driver
In the MongoDB version, I have the latest 5.5 or later selected I have set this URL in .env
mongodb+srv://:@cluster0.bqy3vdg.mongodb.net/?retryWrites=true&w=majority
I have added a username and password and I am using this code
var createAndSavePerson = (done) => {
let person = new Person({
name: "bhavik",
age: 30,
favoriteFoods: ['IT'],
});
person.save(function(err, data) {
if (err) {
console.log(err);
} else {
done(null, data);
}
});
};
but it gives me error when I add the URL http://localhost:3000/ in Solution Link then it gives me an error
// running tests Creating and saving a db item should succeed (Test timed out) // tests completed
Failed:Creating and saving a db item should succeed
and the terminal showing this error
MongooseError: Operation `people.insertOne()` buffering timed out after 10000ms
at Timeout.<anonymous> (C:\Users\HOME\OneDrive\Desktop\boilerplate-mongomongoose-main\boilerplate-mongomongoose-main\node_modules\mongoose\lib\drivers\node-mongodb-native\collection.js:198:23)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
how can I fix this