集合选项不匹配
描述
格式
{ type: "CollectionOptionsMismatch", description: "<string>", details: { namespace: "<string>", options: <array> } }
CollectionOptionsMismatch
不一致性文档包含以下字段
字段 | 类型 | 描述 |
---|---|---|
类型 | 字符串 | 不一致性文档的类型。对于此不一致性类型,返回值为 |
描述 | 字符串 | 描述在元数据中找到的不一致性。 |
细节 | 文档 | 包含有关数据库和分片集群中不一致性存在位置的额外信息的文档。 |
details.namespace | 字符串 | 指示存在不一致性的数据库和集合。 |
details.options | 数组 | 按分片或配置服务器列出找到的不匹配选项。 |
示例
使用db.adminCommand()
方法调用 checkMetadataConsistency
命令
db.adminCommand( { checkMetadataConsistency: 1 } )
该方法返回一个游标,其中包含显示在分片元数据中找到的不一致性的文档批处理。以下示例显示了一个包含 CollectionOptionsMismatch
不一致性文档的游标
{ cursor: { id: Long("0"), ns: "test.$cmd.aggregate", firstBatch: [ { type: "CollectionOptionsMismatch", description: "Found collection with mismatching options across shards and/or config server", details: { namespace: "test.authors", options: [ { "options": { "capped": true }, "shards": [ "shard0" ] }, { "options": { "capped": false }, "shards": [ "shard1", "config" ] } ] } } ], }, ok: 1 }