试试看,好像您正在使用MongoDB地图集
mongoose
.connect( uri, { useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true })
.then(() => console.log( 'Database Connected' ))
.catch(err => console.log( err ));
并转到MongoDB Atlas
-> NetworkAccess
-> Edit
->并添加Current IP address
它!!