走同样的路,发现不同的人生
Solved, the problem is that the database is disconnected and needs to be reconnected. I introduced it in the following blog: Solution
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
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