Definición
sh.disableMigrations(namespace)Disables migrations for the specified namespace of the sharded collection. The balancer does not migrate chunks for the collection you pass to
sh.disableMigrations()until migrations are re-enabled usingsh.enableMigrations(). For more information on chunk migrations, see Manage Sharded Cluster Balancer.Importante
You can only run
sh.disableMigrations()on amongosinstance. If you runsh.enableMigrations()on amongodinstance, the method returns an error.The
sh.disableMigrations()method has the following parameter:ParameterTipoDescripciónnamespacestring
El namespace de la colección.
Compatibilidad
Este método está disponible en implementaciones alojadas en los siguientes entornos:
MongoDB Enterprise: La versión basada en suscripción y autogestionada de MongoDB
MongoDB Community: La versión de MongoDB con código fuente disponible, de uso gratuito y autogestionada.
Nota
Puedes verificar el estado de la migración usando sh.status(), que muestra el campo allowMigrations para cada colección.