setAllowMigrations
Definição
setAllowMigrations
Prevents the start of new automatic migrations on a collection, prevents in-flight manual migrations from committing, and excludes the collection from new balancer rounds.
Compatibilidade
Esse comando está disponível em implantações hospedadas nos seguintes ambientes:
MongoDB Atlas: o serviço totalmente gerenciado para implantações do MongoDB na nuvem
Importante
Este comando não é suportado em instâncias sem servidor. Para obter mais informações, consulte Comandos não suportados.
MongoDB Enterprise: a versão autogerenciada e baseada em assinatura do MongoDB
MongoDB Community: uma versão com código disponível, de uso gratuito e autogerenciada do MongoDB
Sintaxe
O comando tem a seguinte sintaxe:
db.adminCommand( { setAllowMigrations: "<db>.<collection>", allowMigrations: <true|false> } )
Campos de comando
The command takes the following parameters:
Campo | Tipo | Descrição |
---|---|---|
| The collection to modify. | |
| Se
Se
|
Comportamento
setAllowMigrations
requires the same privileges as
moveChunk
.
Exemplo
This operation prevents migrations on the store.inventory
collection:
db.adminCommand( { setAllowMigrations: "store.inventory", allowMigrations: false } )