Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Last active May 10, 2018 01:46
Show Gist options
  • Save sarjarapu/95d90ebeebf44653db387af983bd9d9a to your computer and use it in GitHub Desktop.
Save sarjarapu/95d90ebeebf44653db387af983bd9d9a to your computer and use it in GitHub Desktop.
The MongoDB currentOp command to help you find all the write operations that are waiting for a lock.
db.adminCommand({
"currentOp": true,
"waitingForLock" : true,
"$or": [
{ "op" : { "$in" : [ "insert", "update", "remove" ] } },
{ "query.findandmodify": { "$exists": true } }
]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment