Skip to content

Instantly share code, notes, and snippets.

@chrisckchang
Last active May 4, 2016 04:30
Show Gist options
  • Save chrisckchang/8788594 to your computer and use it in GitHub Desktop.
Save chrisckchang/8788594 to your computer and use it in GitHub Desktop.
Command for getting current operations on a MongoDB
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) printjson(op);
}
)
@joeysino
Copy link

joeysino commented May 4, 2016

One-liners:

db.currentOp().inprog.filter( op => op.secs_running > 5 )

db.currentOp().inprog.filter( op => op.secs_running > 5 ).forEach(printjson)

Thanks for the article!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment