How to list connections in Secondary Nodes In my cluster on Atlas, have a many connections in secondary nodes.
How to list this connections?

When execute this command, list the current connections in primary node.

db.currentOp(true).inprog.reduce(
  (accumulator, connection) =&gt; {
    ipaddress = connection.client ? connection.client.split(":")[0] : "unknown";
    accumulator[ipaddress] = (accumulator[ipaddress] || 0) + 1;
    accumulator["TOTAL_CONNECTION_COUNT"]++;
    return accumulator;
  },
  { TOTAL_CONNECTION_COUNT: 0 }
)


{
    "TOTAL_CONNECTION_COUNT" : 229,
}


But, I have 700 connection in replicaSet.

Thank's
Go to the command line tools





Copy mongostat command under Set Up Diagnostics section





Update password and add --discover option at the end
Run it in any command-line tool
You should be able to see the number of connections as below for all primary and secondaries