用猫鼬连接到Mlab
嗨,我正在尝试建立一个简单的连接
mongoose.connect('mongodb://JFalcon:[email protected]:19476/hidonshabat', {useMongoClient: true}, function(err){
if(err) {
console.log('Some problem with the connection ' +err);
} else {
console.log('The Mongoose connection is ready');
}
})
如你所见,这是网址!请帮我
回答如下:请更正如下
mongoose.connect('mongodb://<dbuser>:<dbpassword>@ds119476.mlab:19476/hidonshabat',
{useNewUrlParser: true },function(err)=>{
{
if(err) {
console.log('Some problem with the connection ' +err);
} else {
console.log('The Mongoose connection is ready');
}
})