Add 'auto_reconnect' to MongoDB configuration. Add 'error' listeners to prevent uncaught expections.