<commit_before>var db = require('../aDbDriver.js')();
var mongoose = require('mongoose');
var path = require('path');

mongoose.connection.on('error', function (err) {
    console.log('[MongoDB Driver] Error while trying to connect');
});

db._models = [];
db._modelPath = '/models/entities/';

db.connect = function (host, port, database, user, password) {
    if (!mongoose.connection.readyState) {
        mongoose.connect('mongodb://' + user + ':' + password + '@' + host + ':' + port + '/' + database);
    }
};

db.disconnect = function () {
    if (mongoose.connection.readyState) {
        mongoose.disconnect();<commit_msg>- structural changes in api controller and db driver - implemented recursive calls with mongoose populate - deleted entity calls in controller<commit_after>var db = require('../aDbDriver.js')();
var mongoose = require('mongoose');
var path = require('path');

mongoose.connection.on('error', function (err) {
    console.log('[MongoDB Driver] Error while trying to connect');
});

db._models = [];
db._modelPath = '/models/entities/';

db.connect = function (host, port, database, user, password) {
    if (!mongoose.connection.readyState) {
        mongoose.connect('mongodb://<' + user + ':' + password + '@' + host + ':' + port + '/' + database);
    }
};

db.disconnect = function () {
    if (mongoose.connection.readyState) {
        mongoose.disconnect();
{'fraction_non_alphanumeric': 0.17790530846484937, 'fraction_numerical': 0.0, 'mean_word_length': 3.8947368421052633, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2842781', 'n_tokens_mistral': 419, 'n_tokens_neox': 431, 'n_words': 102}