Docs Menu
Docs Home
/
MongoDB Manual
/ / /

sh.disableBalancing()

On this page

  • Description
  • Compatibility
sh.disableBalancing(namespace)

Disables the balancer for the specified sharded collection. This does not affect the balancing of chunks for other sharded collections in the same cluster.

Important

You can only run sh.disableBalancing() on a mongos instance. sh.disableBalancing() errors if run on mongod instance.

The sh.disableBalancing() method has the following parameter:

Parameter
Type
Description
namespace
string
The namespace of the collection.

For more information on the balancing process, see Manage Sharded Cluster Balancer and Sharded Cluster Balancer.

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

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

Important

This command is not supported in M0, M2, and M5 clusters. For more information, see Unsupported Commands.

Back

sh.disableAutoSplit