For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

sh.getTransitionToDedicatedConfigServerStatus()

sh.getTransitionToDedicatedConfigServerStatus()

Shows the status of the transition from an embedded config server to a dedicated config server.

New in version 9.0.

Important

mongosh Method

This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.

For the database command, see the getTransitionToDedicatedConfigServerStatus command.

For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.

This method is available in deployments hosted in the following environments:

sh.getTransitionToDedicatedConfigServerStatus()

For output fields, see the getTransitionToDedicatedConfigServerStatus command.

If you have authorization enabled, you must have the clusterManager role or any role that includes the removeShard action.

If the embedded config server is also the primary of one of the cluster's databases, then you must manually move the databases to a new shard after migrating all data from the shard. See the movePrimary command and the Remove Shards from a Sharded Cluster for more information.

If one of the unsharded collections is on the embedded config server, you must first migrate the collection to a different shard.

To migrate an unsharded collection, see the moveCollection command.

The following example returns the draining status of the config shard during a transition to a dedicated config server:

sh.getTransitionToDedicatedConfigServerStatus()
{
"state" : "ongoing",
"remaining" : {
"chunks" : NumberLong(2),
"collectionsToMove" : NumberLong(1),
"dbs" : NumberLong(1),
"jumboChunks" : NumberLong(0),
"estimatedRemainingBytes" : NumberLong(18)
},
"msg" : "draining ongoing",
"dbsToMove" : [
"testDB"
],
"note" : "you need to call moveCollection for collectionsToMove and afterwards movePrimary for the dbsToMove",
"collectionsToMove" : [
"testDB.testCollUnsharded"
],
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1772210444, 27),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
},
"operationTime" : Timestamp(1772210444, 27)
}