In mongodb shell "db.serverStatus().connections" gives output something like:
{
"current" : 43,
"available" : 51157,
"totalCreated" : NumberLong(3988)
}
So, my concern is how to get the same output through pymongo.??
Issue the MongoDB command "serverStatus" to get the output and save it to a variable:
connections_dict = db.command("serverStatus")["connections"]