我有一个看起来像这样的集合:
{
"_id": "5c90e8736441c96cc8e5c703",
"meta": {
"schemaVersion": 1,
"locHint": {
"region": "150",
"country": "GBR"
}
},
"name": "My test study"
}
Run Code Online (Sandbox Code Playgroud)
和以下验证器:
{
"$jsonSchema": {
"bsonType": "object",
"required": [
"meta.schemaVersion"
"meta.locHint.region",
"meta.locHint.country",
"name"
],
"properties": {
"meta.schemaVersion": {
"bsonType": "int",
"description": "Version counter used schema changes"
},
"meta.locHint.region": {
"bsonType": "string",
"pattern": "^[0-9]{3}$",
"description": "meta.locHint.region is required to be a valid iso3166 region (3 digits)"
},
"meta.locHint.country": {
"bsonType": "string",
"pattern": "^[A-Z]{3}$",
"description": "meta.locHint.country is required to be a valid …Run Code Online (Sandbox Code Playgroud) 我有一个 Jhipster Spring Boot 项目。最近我从mlabs独立沙箱转移到 Atlas 集群沙箱 M0 免费层副本集。它甚至可以工作,我已经对它进行了一些数据库操作。但是现在由于某种原因然后出现了读取权限错误
Error creating bean with name 'mongobee' defined in class path resource [DatabaseConfiguration.class]: Invocation of init method failed; nested exception is com.mongodb.MongoQueryException: Query failed with error code 8000 and error message 'user is not allowed to do action [find] on [test.system.indexes]' on server ********-shard-00-01-mfwhq.mongodb.net:27017
Run Code Online (Sandbox Code Playgroud)
您可以在此处查看完整堆栈https://pastebin.com/kaxcr7VS
我搜索了高低,我能找到的只是 M0 层用户没有权限覆盖我没有做的管理数据库。
即使现在与 Mlabs DB 的连接工作正常,但在 Atlas DB M0 层上存在此问题。
Mongo 数据库版本:3.4
罐子和它的版本名称:'mongobee',版本:'0.10' 名称:'mongo-java-driver',版本:'3.4.2'
@Neil Lunn 我用来连接的用户 ID 是管理员的用户 ID,连接读写通过 shell 或 Robo3T(mongo …
我最近4.2.0从4.0.2. 在以前的版本中,用户可以访问 system.indexes 但升级后,用户无法访问 system.indexes 集合。用户已具有 readWrite 角色。另外,我尝试给 dbAdmin,但仍然没有运气。
为 mongo 启用调试日志后,它向我显示not authorized for query on testdb.system.indexes src/mongo/db/commands/find_cmd.cpp 170.
有人遇到过这个问题吗?
下面是输出
{
"role" : "read",
"db" : "testdb",
"isBuiltin" : true,
"roles" : [ ],
"inheritedRoles" : [ ],
"privileges" : [
{
"resource" : {
"db" : "testdb",
"collection" : ""
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "testdb", …Run Code Online (Sandbox Code Playgroud) 我计划将基于 mongodb 的迁移工具集成到我的 Spring Boot 应用程序中,该应用程序在项目中具有 spring-data 依赖项。我发现主要的两个库 1) Mongobee 2) Mongock。
我需要一些反馈,我应该选择哪一个?提前致谢!