关于nodejs DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

const mongoose = require('mongoose')

mongoose.connect("mongodb://localhost:27017/study", {useNewUrlParser:true}, function(err){

  if(err){

    console.log('Connection Error:' + err)

  }else{

    console.log('Connection success!')

  }

})

posted @ 2018-07-25 08:49  甜珊贝奇  阅读(15056)  评论(3编辑  收藏  举报