<commit_before>/**
 * Created by wayne on 2/13/15.
 */

var global = require('../config');
var mongoose = require('mongoose');


// open mongo database
// path and authentication in config.js
mongoose.connect(global.mongoDb.path, {
  user: global.mongoDb.user,
  pass: global.mongoDb.pass
});


// on connection success ...
mongoose.connection.on('connected', function(){
  if (global.environment === 'dev') {
    console.log('Mongo database connected.');
  }
});
// on connection error ...
mongoose.connection.on('error', function(error){
  if (global.environment === 'dev') {
    console.log('Mongo database error.');
    return console.log('>', Error);
  }
});

module.exports = mongoose;<commit_msg>test: commented mongoDB.js<commit_after>var global = require('../config');
var mongoose = require('mongoose');

// Connects to MongoDB using credentials in config.js.
// Note that config.js is in the .gitignore.
mongoose.connect(global.mongoDb.path, {
  user: global.mongoDb.user,
  pass: global.mongoDb.pass
});

mongoose.connection.on('connected', function(){
  if (global.environment === 'dev') {
    console.log('Mongo database connected.');
  }
});

mongoose.connection.on('error', function(error){
  if (global.environment === 'dev') {
    console.log('Mongo database error.');
    return console.log('>', Error);
  }
});

module.exports = mongoose;
{'fraction_non_alphanumeric': 0.17746686303387335, 'fraction_numerical': 0.003681885125184094, 'mean_word_length': 4.052044609665428, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7218291', 'n_tokens_mistral': 426, 'n_tokens_neox': 436, 'n_words': 99}