Aggregation on currentOp

Hi ,

just need some help on formulating a query for monitoring long running processes in mongodb. i wanted to come up for a query that will get all active sessions from all users with a conditional OR that will be true = condition is if there is a query that is running base from secs_running field for more than 1800 seconds, OR there are 8 or more sessions that is already running base from secs_running more than 600 seconds

currently i already formulated the below query and having trouble on the next stage to include

db.getSiblingDB(“admin”).aggregate( [
{ $currentOp : { allUsers: true, idleSessions: false} },
{ $match : { active: true , ns : {$ne : “”}, op : {$ne : “none”}

] )

i’m still learning on complex queries… thank you in advance