【发布时间】:2019-09-19 14:22:29
【问题描述】:
我正在编写 NodeJS/express API 并在连接到 mongo 服务器时遇到以下警告:
Warning: no saslprep library specified. Passwords will not be sanitized
在文档或 github/google 中未发现此警告 - 是缺少操作系统 (linux) 库还是节点包?
这是连接代码示例:
const client = await MongoClient.connect(`mongodb://${auth[0]}:${auth[1]}@${url}/admin`, {
useNewUrlParser: true
});
this.db = client.db(database);
我怎样才能摆脱它?
其他信息:
Mongodb 服务器:docker mongo:latest,截至目前已解析为 4.0.4
mongodb 库:3.1.9
【问题讨论】: