Skip to content

Instantly share code, notes, and snippets.

@jamesridgway
Created May 25, 2017 07:00
Show Gist options
  • Save jamesridgway/669704f3b34b9554038f195cdf6ea076 to your computer and use it in GitHub Desktop.
Save jamesridgway/669704f3b34b9554038f195cdf6ea076 to your computer and use it in GitHub Desktop.
Mongo shell script for displaying status of in-progress index builds
var currentOps = db.currentOp();
print("Index Status:");
if(!currentOps.inprog || currentOps.inprog.length < 1) {
print("No operations in progress");
} else {
for(o in currentOps.inprog) {
var op = currentOps.inprog[o];
if(op.msg && op.msg.match(/Index Build/)) {
print(op.opid+' - '+op.msg);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment