sh.disableAutoMerger()
Definition
New in version 7.0.
Disables automatic chunk merges for a namespace.
sh.disableAutoMerger()
is a mongosh
helper method. It
is effectively the same as running the
configureCollectionBalancing
command with the
enableAutoMerger
field set to false
.
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 configureCollectionBalancing
command.
For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.
Compatibility
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, M5, and Flex clusters. For more information, see Unsupported Commands.
MongoDB Enterprise: The subscription-based, self-managed version of MongoDB
MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB
Syntax
sh.disableAutoMerger( <namespace> )
Method Field
The method takes the following field:
Field | Type | Necessity | Description |
---|---|---|---|
| String | Required | Namespace in the format |
Behavior
When the method runs, it stops the AutoMerger. Any in progress operations issued by the AutoMerger are completed.
Example
The following example disables automatic chunk merges for
"testDatabase.myCollection"
. Run the example from
mongos
:
sh.disableAutoMerger( "testDatabase.myCollection" )
Learn More
sh.startAutoMerger()
methodsh.stopAutoMerger()
methodsh.enableAutoMerger()
method
configureCollectionBalancing
commandmergeAllChunksOnShard
commandautoMergerIntervalSecs
parameterautoMergerThrottlingMS
parameter