Definición
sh.enableMigrations(namespace)Enables migrations for the specified namespace of the sharded collection, but does not start chunk migrations. The balancer includes the collection you pass to
sh.enableMigrations()in migration operations the next time it runs. For more information on chunk migrations, see Manage Sharded Cluster Balancer.Importante
You can only run
sh.enableMigrations()on amongosinstance. If you runsh.enableMigrations()on amongodinstance, the method returns an error.The
sh.enableMigrations()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.