首页 > Web开发 > 详细

关于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.

时间:2018-07-25 10:14:32      阅读:1846      评论:0      收藏:0      [点我收藏+]

标签:nodejs   require   cati   fun   mongoose   keyword   rec   err   params   

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

})

关于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.

标签:nodejs   require   cati   fun   mongoose   keyword   rec   err   params   

原文:https://www.cnblogs.com/TomAndJerry/p/9363951.html

(9)
(1)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号