【发布时间】:2016-10-25 14:11:54
【问题描述】:
我在本地系统中使用 MongoDB 和 mongoose,其中 mongodbURL 没有用户名和密码。因此,当我使用语法运行它时,第一次创建数据库时使用了
mongodb://localhost:27012/database
但现在我想为数据库使用用户名和密码,因此,我使用了给定的语法
mongodb://username:password@localhost:27012/database
但我现在没有自动创建用户,脚本给了我一个身份验证失败错误
第一次应该如何创建用户?
【问题讨论】:
标签: node.js mongodb authentication