【发布时间】:2019-09-11 15:09:07
【问题描述】:
{ MongoNetworkError: 连接 3 到 cluster0-shard-00-02-z0urk.mongodb.net:27017 关闭 在 TLSSocket。 (/home/fahad/Personal Work/Nodejs/Node js start/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:352:9) 在 Object.onceWrapper (events.js:276:13) 在 TLSSocket.emit (events.js:188:13) 在 _handle.close (net.js:610:12) 在 TCP.done (_tls_wrap.js:386:7) 名称:'MongoNetworkError',errorLabels:['TransientTransactionError'],
[符号(mongoErrorContextSymbol)]:{}}
module.exports = (app, express , mongoose, path, bodyParser) => {
app.use(express.static(path.resolve(__dirname, "../../dist")));
app.use(bodyParser.json());
mongoose.connect('mongodb+srv://fahad:123@cluster0-z0urk.mongodb.net/test?retryWrites=true', {useNewUrlParser: true})
.then(()=>console.log("DB server connect"))
.catch(e => console.log("DB error", e));
};
【问题讨论】:
标签: node.js reactjs mongodb mongoose server