2

In mongodb.log I see

2016-03-31T12:44:11.003+0200 I -        [conn58191]   Index Build (background): 14396400/17648149 81%
2016-03-31T12:44:14.018+0200 I -        [conn58191]   Index Build (background): 14414100/17648154 81%
2016-03-31T12:44:17.008+0200 I -        [conn58191]   Index Build (background): 14439300/17648155 81%
2016-03-31T12:44:20.009+0200 I -        [conn58191]   Index Build (background): 14467800/17648159 81%
2016-03-31T12:44:23.003+0200 I -        [conn58191]   Index Build (background): 14492700/17648161 82%
2016-03-31T12:44:26.003+0200 I -        [conn58191]   Index Build (background): 14520500/17648166 82%
2016-03-31T12:44:29.003+0200 I -        [conn58191]   Index Build (background): 14551500/17648166 82%
2016-03-31T12:44:32.012+0200 I -        [conn58191]   Index Build (background): 14571300/17648170 82%
2016-03-31T12:44:35.001+0200 I -        [conn58191]   Index Build (background): 14584100/17648171 82%
2016-03-31T12:44:38.008+0200 I -        [conn58191]   Index Build (background): 14600100/17648174 82%
2016-03-31T12:44:41.004+0200 I -        [conn58191]   Index Build (background): 14619700/17648178 82%
2016-03-31T12:44:44.005+0200 I -        [conn58191]   Index Build (background): 14641700/17648184 82%
2016-03-31T12:44:47.094+0200 I -        [conn58191]   Index Build (background): 14665900/17648185 83%
2016-03-31T12:44:50.004+0200 I -        [conn58191]   Index Build (background): 14685600/17648188 83%
2016-03-31T12:44:53.002+0200 I -        [conn58191]   Index Build (background): 14700800/17648188 83%

I wish to see this in mongo shell. I also wish to see which index.

I googled and found

db.currentOp(
    {
      $or: [
        { op: "query", "query.createIndexes": { $exists: true } },
        { op: "insert", ns: /\.system\.indexes\b/ }
      ]
    }
)

But this query gives only

{ "inprog" : [ ], "ok" : 1 }

I wish to see all details.

2 Answers 2

1

I have noticed the same thing in last week. Sometimes, the mongo shell returns any empty array:

  1. Try running the currentOp() many times to get the progress.
  2. Use use db command and then perform db.currentOp()
0

I find this command helps to show index progress:

db.currentOp().inprog.map(a => a.msg)
[
    undefined,
    undefined,
    undefined,
    undefined,
    undefined,
    undefined,
    "Index Build: scanning collection Index Build: scanning collection: 16448156/54469342 30%",
    undefined,
    undefined
]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.