Docs 主页 → 开发应用程序 → MongoDB Manual
setAllowMigrations
定义
语法
该命令具有以下语法:
db.adminCommand( { setAllowMigrations: "<db>.<collection>", allowMigrations: <true|false> } )
命令字段
该命令采用以下参数:
字段 | 类型 | 说明 |
---|---|---|
string | 要修改的collection。 | |
boolean |
行为
例子
此操作会阻止在store.inventory
collection上的迁移:
db.adminCommand( { setAllowMigrations: "store.inventory", allowMigrations: false } )