连接Mongodb pass option { useNewUrlParser: true } to MongoClient.connect
Nodejs /Koa连接 的时候提示(node:9192) 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连接Mongodb4.0的时候出现的
Mongodb4.0中连接数据库需要加上 { useNewUrlParser: true }
这个参数。
如下图的第二个参数加入上面 对象就可以了。
页:
[1]