最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

用猫鼬连接到Mlab

IT培训 admin 4浏览 0评论

用猫鼬连接到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');
        }
    })

用猫鼬连接到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');
        }
    })

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论