How to terminate query started from mongos?

How to terminate a query ran from mongos on a 3 shards sharded cluster, without terminating from individual nodes.
Version: 4.0.14

You can use the killOp command.

Starting in MongoDB 4.0, the killOp command can be run on a mongos and can kill queries (i.e. read operations) that span shards in a cluster.

3 Likes