nodejs+mongoose mongodb服务停止,然后恢复,mongoose怎么自动连接上呢
nodejs+mongoose mongodb服务停止,然后恢复,mongoose怎么自动连接上呢? var db = mongoose.connection; db.on(‘error’,function callback(){ console.error.bind(console, ‘connection error’); }); db.once(‘open’, function callback() { console.log(‘db open’); });