Created
May 25, 2017 07:00
-
-
Save jamesridgway/669704f3b34b9554038f195cdf6ea076 to your computer and use it in GitHub Desktop.
Mongo shell script for displaying status of in-progress index builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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