Update in MongoDB Connection

With this commit I change the connection to be more simple and always check if the driver still connected. With the older version, when the database restart or shutdown, the connection fail and cant back, because "connected" flag is always true.