Description描述
CollectionOptionsMismatchA collection contains mismatching options across different shards.一个集合包含不同分片之间的不匹配选项。New in version 8.0.在版本8.0中新增。 (Also available starting in 7.0.23从7.0.23开始也可用)
Format格式
{
type: "CollectionOptionsMismatch",
description: "<string>",
details: {
namespace: "<string>",
options: <array>
}
}
CollectionOptionsMismatch inconsistency documents contain these fields:不一致文档包含以下字段:
type | CollectionOptionsMismatch for this inconsistency type.CollectionOptionsismatch的值。 | |
description | ||
details | ||
details.namespace | ||
details.options |
Example示例
Use the 使用db.adminCommand() method to call the checkMetadataConsistency command:db.adminCommand()方法调用checkMetadataConsistency命令:
db.adminCommand( { checkMetadataConsistency: 1 } )
The method returns a cursor with a batch of documents showing the inconsistencies found in the sharding metadata. The example below shows a cursor with a 该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了一个带有CollectionOptionsMismatch inconsistency document: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
}