Docs HomeMongoDB Manual

sh.disableAutoMerger()

Definition定义

sh.disableAutoMerger(namespace)

New in version 7.0. 7.0版新增。

Disables automatic chunk merges for a namespace.禁用命名空间的自动合并。

sh.disableAutoMerger() is a mongosh helper method. 是一个mongosh辅助方法。It is effectively the same as running the configureCollectionBalancing command with the enableAutoMerger field set to false.这实际上与在enableAutoMerger字段设置为false的情况下运行configureCollectionBalancing命令相同。

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.

For the legacy mongo shell documentation, refer to the documentation for the corresponding MongoDB Server release:

mongo shell v4.4

Syntax语法

sh.disableAutoMerger( <namespace> )

Method Field方法字段

The method takes the following field:该方法采用以下字段:

Field字段Type类型Necessity必要性Description描述
namespaceStringRequired必要的Namespace in the format "<database>.<collection>". 命名空间,格式为"<database>.<collection>"Method enables automatic chunk merges for the supplied namespace.方法为提供的命名空间启用自动块合并。

Behavior行为

When the method runs, it stops the AutoMerger. Any in progress operations issued by the AutoMerger are completed.当该方法运行时,它将停止AutoMerger。AutoMerger发布的任何正在进行的操作都已完成。

Example实例

The following example disables automatic chunk merges for "testDatabase.myCollection". 以下示例禁用"testDatabase.myCollection"的自动块合并。Run the example from mongos:运行mongos中的示例:

sh.disableAutoMerger( "testDatabase.myCollection" )

Learn More了解更多信息