关于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!‘) }

})

文章来自:https://www.cnblogs.com/TomAndJerry/p/9363951.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3