返回 首页

mongo: 查看创建索引的进度


使用db.ming_mark_history.createIndex({mark: 1, _id: -1}, {background: true})进行创建索引, 但是执行一直未完成, 不知道索引的进度

在mongo sheel 中执行

db.currentOp(true).inprog.forEach(function(op){ if(op.msg!==undefined) print(op.msg) })

可以查看状态:

[
  {
    "0": "Index Build (background) Index Build (background): 251160/622703 40%"
  },
  {
    "0": "step 2 of 6"
  }
]

参考: https://stackoverflow.com/questions/22309268/mongodb-status-of-index-creation-job mongodb status of index creation job


登录