总是出现猫鼬连接错误

时间:2017-08-04 16:59:36

标签: mongodb mongoose hapijs

当我尝试使用mongoose连接mongodb时发生以下错误。

  { db: { native_parser: true },
   server: { poolSize: 5 },
    user: '',
    pass: '' }
  

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++运行于:http://127.0.0.1:5000 DB错误作业的服务器:{[MongoError:   auth failed] name:'MongoError',message:'auth failed',ok:0,   errmsg:'auth failed',代码:18} var option = {db:{native_parser:   true},server:{poolSize:5},user:db.username,pass:db.password,}

     

mongoose.connect(option,option,function(err){if(err){process.exit(1);} else {console.log('MongoDB Connected',mongoUrl);   }})

0 个答案:

没有答案