Docs Menu
Docs Home
/
MongoDB Manual
/ / /

HiddenShardedCollection

On this page

  • Description
  • Format
  • Example
HiddenShardedCollection

A collection is registered in the config.collections cluster catalog under a non-existent database.

New in version 7.0.

{
type: "HiddenShardedCollection",
description: "<string>",
details: {
namespace: "<string>",
collection: "<object>",
}
}

HiddenShardedCollection inconsistency documents contain the following fields:

Field
Type
Description
type
string

Type of inconsistency document. Returns a value of HiddenShardedCollection 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.collection
document

Information about the collection.

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 HiddenShardedCollection inconsistency document:

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "HiddenShardedCollection",
description: "Found sharded collection but relative database does not exist",
details: {
namespace: "test.authors",
collection: {
_id: "test.authors",
lastmodEpoch: ObjectId("64ddd78de906038182671674"),
lastmod: ISODate("2023-08-17T08:17:17.944Z"),
timestamp: Timestamp(1692260237, 58),
uuid: new UUID("69317741-7bc5-4eca-8877-7858cecf67d6"),
key: {
"skey" : 1
},
unique: false,
noBalance: false
}
}
}
],
},
ok: 1
}

Back

CorruptedZoneShardKey