Definição
abortReshardCollectionNovidade na versão 5.0.
During a resharding operation, you can abort the operation with the
abortReshardCollectioncommand.You can abort a resharding operation at any point until the commit phase. If the resharding operation has reached the commit phase before you run the
abortReshardCollectioncommand, the command returns an error.Dica
In
mongosh, this command can also be run through thesh.abortReshardCollection()helper method.Helper methods are convenient for
mongoshusers, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.
Compatibilidade
Esse comando está disponível em implantações hospedadas nos seguintes ambientes:
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
Observação
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
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( { abortReshardCollection: "<database>.<collection>" } )
Exemplo
Abortar uma operação de refragmentação
O exemplo a seguir aborta uma operação de refragmentação em execução na collection sales.orders :
db.adminCommand({ abortReshardCollection: "sales.orders" })