how to check mongodb connection code example
Example: mongodb check connection status
> var status = db.serverStatus()
> status.connections
{"current" : 21, "available" : 15979}
>
> var status = db.serverStatus()
> status.connections
{"current" : 21, "available" : 15979}
>