Docs Menu

Docs HomeMongoDB Manual

setAllowMigrations

On this page

  • Definition
  • Syntax
  • Command Fields
  • Behavior
  • Example
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.

The command has the following syntax:

db.adminCommand(
{
setAllowMigrations: "<db>.<collection>",
allowMigrations: <true|false>
}
)

The command takes the following parameters:

Field
Type
Description
setAllowMigrations
string

The collection to modify.

boolean

If false:

  • MongoDB prevents new automatic migrations on the collection

  • in-flight manual migrations will not be committed

  • the collection will be excluded from new balancer rounds

If true:

setAllowMigrations requires the same privileges as moveChunk.

This operation prevents migrations on the store.inventory collection:

db.adminCommand( {
setAllowMigrations: "store.inventory",
allowMigrations: false
} )
←  reshardCollectionsetShardVersion →
Share Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.