<commit_before>"use strict";

function _getDb() {
    return new Promise((resolve, reject) => {
        let factory = require('mongo-factory');
        factory.getConnection(process.env.DB_CONNECTIONSTRING)
            .then(dbInstance => {
                dbInstance.use = dbInstance.use ||((collectionName) => {
                    return dbInstance.collection(collectionName)
                });
                resolve(dbInstance);
            })
            .catch(e => {
                reject(e);
            });
    });
}

module.exports = {
    getDb: _getDb,

    getManager: function (ManagerType) {
        return _getDb()
            .then(db => {
                return Promise.resolve(new ManagerType(db, {
                    username: "dev"
                }));
            })
    }
}<commit_msg>Revert "update helper"<commit_after>"use strict";

function _getDb() {
    return new Promise((resolve, reject) => {
        let factory = require('mongo-factory');
        factory.getConnection(process.env.DB_CONNECTIONSTRING)
            .then(dbInstance => {
                resolve(dbInstance);
            })
            .catch(e => {
                reject(e);
            });
    });
}

module.exports = {
    getDb: _getDb,

    getManager: function (ManagerType) {
        return _getDb()
            .then(db => {
                return Promise.resolve(new ManagerType(db, {
                    username: "dev"
                }));
            })
    }
}
{'fraction_non_alphanumeric': 0.12796208530805686, 'fraction_numerical': 0.0, 'mean_word_length': 1.4924114671163575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2076513', 'n_tokens_mistral': 404, 'n_tokens_neox': 389, 'n_words': 67}