<commit_before>'use strict';

const mongoose = require('mongoose');

const Base = require('./Base');

mongoose.Promise = global.Promise;


/**
 * A database backend using Mongo.
 */
class MongoDatabase extends Base {
    constructor(options) {
        super(options);
        mongoose.connection.on('error', err => console.error(`MongoDB connection error: ${err}`));
        mongoose.connection.on('open', () => console.log('Connected to MongoDB'));
    }

    async connect() {
        return mongoose.connect(this.getConfig().get('uri'), { server: { reconnectTries: Number.MAX_VALUE } });
    }

    async disconnect() {
        return mongoose.disconnect();
    }
}

module.exports = MongoDatabase;<commit_msg>Get rid of a Mongoose warning<commit_after>'use strict';

const mongoose = require('mongoose');

const Base = require('./Base');

mongoose.Promise = global.Promise;


/**
 * A database backend using Mongo.
 */
class MongoDatabase extends Base {
    constructor(options) {
        super(options);
        mongoose.connection.on('error', err => console.error(`MongoDB connection error: ${err}`));
        mongoose.connection.on('open', () => console.log('Connected to MongoDB'));
    }

    async connect() {
        return mongoose.connect(this.getConfig().get('uri'), {
            useMongoClient: true,
            reconnectTries: Number.MAX_VALUE
        });
    }

    async disconnect() {
        return mongoose.disconnect();
    }
}

module.exports = MongoDatabase;
{'fraction_non_alphanumeric': 0.14892183288409702, 'fraction_numerical': 0.0, 'mean_word_length': 3.2067988668555243, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5903507', 'n_tokens_mistral': 430, 'n_tokens_neox': 428, 'n_words': 93}