MongoDB错误:无法使用'命令'readMode,降级为'legacy'模式

dgn*_*res 7 mongodb mongo-shell

所以我使用mongo开发一个项目,执行代码后出错: db.usercollection.insert({ "username" : "testuser1", "email" : "testuser1@testdomain.com" })

显示的错误是:

Cannot use 'commands' readMode, degrading to 'legacy' mode WriteResult({
        "writeError" : {
                "code" : 13,
                "errmsg" : "not authorized on watersheds to execute command { insert: \"usercollection\", documents: [ { _id: ObjectId('568d0eda45d472b121116bef'), username: \"testuser1\", email: \"testuser1@testdomain.com\" } ], ordered: true }"
        } })
Run Code Online (Sandbox Code Playgroud)

db.version()是3.0.7,我安装的MongoDB shell版本是3.2.0

我该怎么解决这个问题?

此致,达里尔

小智 2

我只是重新启动 mongod 进程并为我工作。