Question: How can I list client ip , port and connection ID of connections to MongoDB? I want to connect through the MongoDB command line and extract this information as I'm testing some HA failover scenarios. Answer: There's a few different ways to extract the MongoDB connection details - for example you can use netstat. But from the command line - this syntax will report the details required db.currentOp(true).inprog.forEach(function(d){if(d.client)print(d.client, d.connectionId)}) Example output - clientip:port clientid: 127.0.0.1:55552 4668364 10.120.xxx.xxx:60942 4668363 10.120.xxx.xxx:60924 4668357 Read More on MongoDB How to read MongoDB system log file MongoDB cheatsheet Read more →