Reputation: 1654
I wrote a c# program that works with MongoDB.
It finds long time running queries but I can not kill them. I googled so much but I didn't find anything useful.
Can anyone help me with killing the queries?
Upvotes: 1
Views: 666
Reputation: 13138
You must use killOp to stop the query
With your driver you may try something like this
var db = server.GetDatabase("test", WriteConcern.Acknowledged);
var currentOp = db.GetCurrentOp();
var opid = ... fetch from currentOp result
db.RunCommand(new CommandDocument("killOp", opid));
Upvotes: 1