伊谢尔伦2017-04-17 16:12:13
没有遇到过类似的错误,不过顺手搜索了stackoverflow,有类似问题的帖子:
http://stackoverflow.com/ques...
问题大概是和网络的不稳定有关系,所以帖子中有一种方法是修改connect的options:
var options = {
server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } }
};
mongoose.connect(secrets.db, options);
供参考。
Have a great weekend!
Love MongoDB! Have Fun!
攒RP