node.js - 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 中配置的权限没有任何关系
解决方案
推荐阅读
- python - 如何使用 Python 获取文本中的值 [n]?
- android - 如何在我的应用程序中设置我的 DatePicker 对话框
- linux - 如何修复oracle TNS - 远程连接数据库时连接超时错误?
- c# - 为标签报告的对象列表重新排序,然后向下
- javascript - 编辑:如何使用 Bootstrap className 来使用开关?
- mysql - MySql 工作台迁移向导不检索架构
- android - FirebaseRecyclerAdapter 数据库异常
- asp.net-mvc - 多个字段的 NotEmpty 验证
- php - 从巨大的 Excel 电子表格中获取计算值的最佳方法
- mongodb - 如何在 mongodb 中更新 3-d 嵌套数组的元素?