Description描述
MisplacedCollectionIndicates that an unsharded collection exists on the incorrect shard and was not moved with表示不正确的分片上存在未分片的集合,并且该集合未使用moveCollection.moveCollection移动。New in version 7.0.在版本7.0中新增。Changed in version 8.0.在版本8.0中的更改。
Format格式
{
type: "MisplacedCollection",
description: "<string>",
details: {
namespace: "<string>",
shard: "<string>",
localUUID: UUID("<uuid>")
}
}
MisplacedCollection inconsistency documents contain the following fields:不一致文档包含以下字段:
type | MisplacedCollection for this inconsistency type.MisplacedCollection值。 | |
description | ||
details | ||
details.namespace | ||
details.shard | ||
details.localUUID | UUID |
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 该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了一个带有MisplacedCollection inconsistency document:MisplacedCollection不一致文档的游标:
{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "MisplacedCollection",
description: "Found unsharded collection without the appropriate metadata on a shard different from the database primary shard",
details: {
namespace: "test.authors",
shard: "shard02",
localUUID: new UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4")
}
}
],
},
ok: 1
}