Created
June 13, 2016 14:47
-
-
Save chiihuang/9d4833b957245e6b26a88eb0ea427342 to your computer and use it in GitHub Desktop.
Kill Multiple Op in MongoDB 3.2 when opid sometimes negative
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
// Change mydb.mycollection to your target ns | |
var result = db.currentOp(); | |
result.inprog.filter(function(p){return p.ns === 'mydb.mycollection';}).map(function(p){return p.opid >= 0 ? p.opid : Math.pow(2,32) + p.opid;}).forEach(function(pid){ db.killOp(pid);}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment