我试图在Mongo中运行一些shell命令,它位于Docker容器中。
docker exec -it mongodb_mock bash
它打开了Mongo外壳。但当我在其中运行任何命令时,它都会给出验证错误:
> show dbs
2018-08-28T10:12:12.755+0000 E QUERY [thread1] Error: listDatabases failed:{
"ok" : 0,
"errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
"code" : 13,
"codeName" : "Unauthorized"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:62:1
shellHelper.show@src/mongo/shell/utils.js:781:19
shellHelper@src/mongo/shell/utils.js:671:15
@(shellhelp2):1:1
请帮忙。
编辑:这个数据库是通过mongoose/express从另一个容器创建的。