首页 > 解决方案 > MongoError:不允许用户在 [test.users] 上执行操作 [find]

问题描述

我使用 MongoDB Atlas 作为我的数据库,使用 Mongoose 作为我的 Node.Js/MongoDB 后端。我能够成功地将我的 Express 服务器与 MongoDB Atlas 连接起来。但是,当尝试创建对此数据库的 Put 调用时,系统会提示我以下错误:

UnhandledPromiseRejectionWarning: MongoError: user is not allowed to do action [find] on [test.users]

readWriteAnyDatabase在 Atlas 中为我的用户设置了角色,所以我认为它与 Atlas 中配置的权限没有任何关系

标签: node.jsmongodbexpressmongodb-atlas

解决方案


推荐阅读