- Reference >
- Database Commands >
- Sharding Commands >
- setAllowMigrations
setAllowMigrations¶
On this page
Definition¶
-
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:
The command takes the following parameters:
Field Type Description setAllowMigrations string
The collection to modify.
allowMigrations 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
:- MongoDB allows new automatic migrations on the collection
- in-flight manual migrations will be committed
- the collection will be included in new balancer rounds
Behavior¶
setAllowMigrations
requires the same privileges as
moveChunk
.
Example¶
This operation prevents migrations on the store.inventory
collection:
Search Results
- MongoDB Manual
- All Results