Adding robust connection factory for MongoDB.