MongoDB错误:不允许用户在[Admin。]上执行操作[ServerStatus]
我的项目正在使用Nestjs。当我尝试从数据库中编写备份文件时,我遇到了这个错误。
VError: pack collection: 'collection name' failed:
user is not allowed to do action [serverStatus] on [admin.]
at CatchSubscriber.selector (/usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:45:40)
at CatchSubscriber.error (/usr/src/app/node_modules/mongodb-snapshot/node_modules/rxjs/src/internal/operators/catchError.ts:132:23)
at /usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:267:26
at Sink.<anonymous> (/usr/src/app/node_modules/tar-stream/pack.js:175:14)
at Sink.f (/usr/src/app/node_modules/once/once.js:25:25)
at Sink.onfinish (/usr/src/app/node_modules/end-of-stream/index.js:31:27)
...
MongoURI: mongodb+srv://username:password@cluster/databaseName?retryWrites=true&w=majority&authSource=admin
My project is using NestJS. I got this error when I tried to write a backup file from my database.
VError: pack collection: 'collection name' failed:
user is not allowed to do action [serverStatus] on [admin.]
at CatchSubscriber.selector (/usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:45:40)
at CatchSubscriber.error (/usr/src/app/node_modules/mongodb-snapshot/node_modules/rxjs/src/internal/operators/catchError.ts:132:23)
at /usr/src/app/node_modules/mongodb-snapshot/src/connectors/filesystem/FileSystemDuplexConnector.ts:267:26
at Sink.<anonymous> (/usr/src/app/node_modules/tar-stream/pack.js:175:14)
at Sink.f (/usr/src/app/node_modules/once/once.js:25:25)
at Sink.onfinish (/usr/src/app/node_modules/end-of-stream/index.js:31:27)
...
MongoURI: mongodb+srv://username:password@cluster/databaseName?retryWrites=true&w=majority&authSource=admin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论