[英]Error: insertOne()` buffering timed out after 10000ms
I am at the very beginning of learning Mongoose, and I am having trouble saving this model to my database and keep getting an error: insertOne()` buffering timed out after 10000ms我刚开始学习 ZCCADCDEDB567ABAE643E15DCF0974E503Z,我无法将此 model 保存到我的数据库并不断收到错误:insertOne()` 缓冲在 10000 毫秒后超时
This is my code:这是我的代码:
How can I find a solution for this?我怎样才能找到解决方案?
const options = { autoIndex: false, // Don't build indexes maxPoolSize: 10, // Maintain up to 10 socket connections serverSelectionTimeoutMS: 5000, // Keep trying to send operations for 5 seconds socketTimeoutMS: 45000, // Close sockets after 45 seconds of inactivity family: 4 // Use IPv4, skip trying IPv6 }; mongoose.connect(uri, options);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.