这是我的代码。我想连接到Mongodb,但是发出{MongoNetworkError: connection 0 to 127.0.0.1:27017 closed}
错误。
MongoClinet.connect("mongodb://127.0.0.1:27017/demo",{ useNewUrlParser: true},(err,db)=>{
if(err)
console.log(err.toString());
else{
console.log("Connected");
}
});
MongoNetworkError: connection 0 to localhost:27017 closed
MongoNetworkError: connection 1 to localhost:27017closed
MongoNetworkError: connection 2 to localhost:27017 closed
最佳答案
删除mongod.lock
并(重新)启动mongod
服务器。
关于javascript - 这是什么错误{MongoNetworkError:连接0到127.0.0.1:8080已关闭}?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54012256/