码迷,mamicode.com
首页 > 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:21:03      阅读:1944      评论:0      收藏:0      [点我收藏+]

标签:key   version   nec   ring   mon   parser   and   string   error:   

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.

标签:key   version   nec   ring   mon   parser   and   string   error:   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有
迷上了代码!