説明
形式
{ type: "IncompatibleUniqueIndexOnShardedCollection", description: "<string>", details: { namespace: "<string>", info: <document> } }
ZonesRangeOverlap 不整合ドキュメントには、次のフィールドが含まれています。
フィールド | タイプ | 説明 |
|---|---|---|
| string | 不整合ドキュメントのタイプ。 この不整合タイプの |
| string | メタデータで見つかった不整合について説明します。 |
| ドキュメント | データベースとシャーディングされたクラスターのどの不整合が存在するかに関する追加情報を含むドキュメント。 |
| string | 不整合が存在するデータベースとコレクションを示します。 |
| ドキュメント | 互換性のないユニークインデックスに関する情報。 |
例
db.adminCommand()メソッドを使用して、checkMetadataConsistency checkIndexesフラグを に設定して コマンドを呼び出します。1
db.adminCommand( { checkMetadataConsistency: 1, checkIndexes: 1 } )
メソッドは、シャーディング メタデータにある不整合を示すドキュメントのバッチを含むカーソルを返します。 以下の例では、 ZonesRangeOverlap不整合ドキュメントを持つカーソルを示しています。
{ cursor: { id: Long("0"), ns: "test.$cmd.aggregate", firstBatch: [ { type: "IncompatibleUniqueIndexOnShardedCollection", description: "Found incompatible index options with uniqueness in a sharded collection", details: { namespace: "test.authors", info: { index: { v: 2, unique: true, key: { author: 1 }, name: "author_1" }, shard: "test-rs1", issue: "Collation must be simple and the shard key must be a prefix of the index key if the index is unique in a sharded collection", shardKey: { author: 1 } } } } ], }, ok: 1 }