<commit_before>var config  = require( './../config.js' );

//=============================================================================
//CONNECTS TO MONGODB AND LOADS UP ALL SCHEMAS
//NOTE: HERE IS WHERE WE CAN CREATE NEW USERS AND SAVE TO DATABASE
//=============================================================================
var mongoose = require( 'mongoose' );
mongoose.connect( config.MONGO_IP + ':' + config.MONGO_PORT + '/chatappdb' );
user = require( './user-schema.js' );<commit_msg>added a little error detection to make sure that everything is working well, and refactored mainDB.js a bit. Hope I'm not stepping on toes<commit_after>var config  = require( './../config.js' );

//=============================================================================
//ESTABLISH CONNECTION
//=============================================================================
var mongoose = require( 'mongoose' );
mongoose.connect( config.MONGO_IP + ':' + config.MONGO_PORT + '/chatappdb' );

var db = mongoose.connection;
db.on( 'error', console.error.bind( console, 'mongo error:' ) );

//=============================================================================
//LOAD SCHEMA
//=============================================================================
user = require( './user-schema.js' );
{'fraction_non_alphanumeric': 0.45887778631821674, 'fraction_numerical': 0.0, 'mean_word_length': 6.3559322033898304, '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': '4073202', 'n_tokens_mistral': 330, 'n_tokens_neox': 303, 'n_words': 87}