Docs Menu
Docs Home
/
MongoDB Manual
/ / /

CollectionOptionsMismatch

On this page

  • Description
  • Format
  • Example
CollectionOptionsMismatch

A collection contains mismatching options across different shards.

New in version 8.0.

{
type: "CollectionOptionsMismatch",
description: "<string>",
details: {
namespace: "<string>",
options: <array>
}
}

CollectionOptionsMismatch inconsistency documents contain these fields:

Field
Type
Description
type
string

Type of inconsistency document. Returns a value of CollectionOptionsMismatch for this inconsistency type.

description
string

Describes the inconsistency found in the metadata.

details
document

Document with additional information on where the inconsistency exists in the database and sharded cluster.

details.namespace
string

Indicates the database and collection where the inconsistency exists.

details.options
array

Lists the mismatching options found per shard or config server.

Use the db.adminCommand() method to call the checkMetadataConsistency command:

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:

{
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
}

Back

Inconsistency Types