Description描述
TrackedUnshardedCollectionHasInvalidKeyAn unsharded collection has an invalid shard key.
New in version 8.0.在版本8.0中新增。
Format格式
{
type: "TrackedUnshardedCollectionHasInvalidKey",
description: "<string>",
details: {
namespace: "<string>",
uuid: UUID("<uuid>"),
shardKey: <document>
}
}
TrackedUnshardedCollectionHasInvalidKey inconsistency documents contain these fields:不一致文档包含以下字段:
type | TrackedUnshardedCollectionHasInvalidKey for this inconsistency type.TrackedUnhardedCollectionHasInvalidKey的值。 | |
description | ||
details | ||
details.namespace | ||
details.uuid | UUID | |
details.shardKey |
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 该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了一个带有TrackedUnshardedCollectionHasInvalidKey inconsistency document:TrackedUnhardedCollectionHasInvalidKey不一致文档的游标:
{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "TrackedUnshardedCollectionHasInvalidKey",
description: "Found tracked unsharded collection with invalid shard-key",
details: {
namespace: "test.authors",
uuid: UUID("ebfba414-b576-4f77-bb0e-0d56f3a53c55"),
shardKey: { "name": 1 }
}
}
],
},
ok: 1
}