check the status of mongodb service code example Example: mongodb get status db.runCommand( { serverStatus: 1 } )