草庐IT

useNewUrlParser

全部标签

node.js - 通过将 useNewUrlParser 设置为 true 来避免 "current URL string parser is deprecated"警告

我有一个数据库包装类,它与某个MongoDB实例建立连接:asyncconnect(connectionString:string):Promise{this.client=awaitMongoClient.connect(connectionString)this.db=this.client.db()}这给了我一个警告:(node:4833)DeprecationWarning:currentURLstringparserisdeprecated,andwillberemovedinafutureversion.Tousethenewparser,passoption{useNew