On database level, how to stop running all queries that are taking more than 5 mins to fetch the results?

We know about socket level timeout settings, that we can mention for each connections. However we are looking for database level setting to kill all the queries that takes more than 5 mins of running time, irrespective of socket level settings. How to achieve this? Pls support.

As of now exploring db.currentOp() to identify the operations that are taking more running time.