<commit_before>var util = require('util');
var mongoose = require('mongoose');
var mongodbFs = require('mongodb-fs');
var config = require('config').DB;

var db = {
	start: function(cb) {
		mongoose.connect(util.format('mongodb://%s:%d/%s', config.host, config.port, config.name), cb);		
	},
	stop: function(cb) {
		mongoose.connection.close(cb);
	}
}

module.exports = db;<commit_msg>Use db url from config if present<commit_after>var util = require('util');
var mongoose = require('mongoose');
var mongodbFs = require('mongodb-fs');
var config = require('config').DB;

var db = {
	start: function(cb) {
		mongoose.connect(config.url || util.format('mongodb://%s:%d/%s', config.host, config.port, config.name), cb);		
	},
	stop: function(cb) {
		mongoose.connection.close(cb);
	}
}

module.exports = db;
{'fraction_non_alphanumeric': 0.19029850746268656, 'fraction_numerical': 0.0, 'mean_word_length': 5.007462686567164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3647864', 'n_tokens_mistral': 295, 'n_tokens_neox': 287, 'n_words': 58}