Docs HomeMongoDB Manual

MisplacedCollection

Description描述

MisplacedCollection

Indicates that an unsharded collection exists on a shard that is not the primary shard.指示非主分片上存在未排序集合。

New in version 7.0. 7.0版新增。

Syntax语法

{
type: "MisplacedCollection",
description: "<string>",
details: {
namespace: "<string>",
shard: "<string>",
localUUID: UUID("<uuid>")
}
}

MisplacedCollection inconsistency documents contain the following fields:不一致性文档包含以下字段:

Field字段Type类型Description描述
typestringType of inconsistency document. 不一致性文档的类型。Returns a value of MisplacedCollection for this inconsistency type. 返回此不一致类型的MisplacedCollection值。
descriptionstringDescribes the nature of the inconsistency found in the metadata. 描述在元数据中发现的不一致性的性质。
detailsdocumentDocument with additional information on where the inconsistency exists in the database and sharded cluster. 文档中包含有关数据库和分片集群中存在不一致性的其他信息。
details.namespacestringIndicates the database and collection where the inconsistency exists. 指示存在不一致的数据库和集合。
details.shardstringThe shard where the inconsistency exists. 存在不一致的分片。
details.localUUIDUUIDThe local UUID of the misplaced collection.放错位置的集合的本地UUID。

Example实例

Use the db.runCommand() command to call the checkMetadataConsistency command:使用db.runCommand()命令调用checkMetadataConsistency命令:

db.runCommand( { checkMetadataConsistency: 1 } )
{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "MisplacedCollection",
description: "Unsharded collection found on shard different from database primary shard",
details: {
namespace: "test.authors",
shard: "shard02",
localUUID: new UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4")
}
}
],
},
ok: 1
}