PHPz2017-04-17 16:12:13
Solved, the problem is that the database is disconnected and needs to be reconnected. I introduced it in the following blog:
Solution
伊谢尔伦2017-04-17 16:12:13
I have never encountered a similar error, but I searched stackoverflow and found posts with similar problems:
http://stackoverflow.com/ques...
The problem is probably related to the instability of the network, so one method in the post is to modify the connect options:
var options = {
server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } } }
};
mongoose.connect(secrets.db, options);
For reference.
Have a great weekend!
Love MongoDB! Have Fun!
Save RP