Show connection count...
- by appName:
db.currentOp(true).inprog.reduce((acc,conn) => { var appName = conn.appName ?? ''; acc[appName] = (acc[appName] ?? 0) + 1; return acc; }, {});
- by client ip
db.currentOp(true).inprog.reduce((acc,conn) => { var ip = conn.client ? conn.client.split(':')[0] : 'internal'; acc[ip] = (acc[ip] ?? 0) + 1; return acc; }, {});