<commit_before>// Load modules

var Mongoose = require('mongoose');
var Hoek = require('hoek');
var Joi = require('joi');


// Declare internals

var internals = {
	schema: Joi.object({
		uri: Joi.string().uri().required(),
		options: Joi.object().optional().default({})	// http://mongoosejs.com/docs/api.html#connection-js
	})
};


exports.register = function (server, options, next) {
	var results = Joi.validate(options, internals.schema);
	Hoek.assert(!results.error, results.error);
	var settings = results.value;

	Mongoose.connect(settings.uri, settings.options, function (err) {

		Hoek.assert(!err, err);

		var connection = Mongoose.connection;
		server.log('hapi-mongoose', 'Database `' + connection.name + 
									'` connected on ' + connection.host +
									':' + connection.port);


		server.on('stop', function () {

			server.log('hapi-mongoose', 'Database `' + connection.name +
										'` closed');
			connection.close();
		});

		next();
	});
};

<commit_msg>fix plugin name<commit_after>// Load modules

var Mongoose = require('mongoose');
var Hoek = require('hoek');
var Joi = require('joi');


// Declare internals

var internals = {
	schema: Joi.object({
		uri: Joi.string().uri().required(),
		options: Joi.object().optional().default({})	// http://mongoosejs.com/docs/api.html#connection-js
	})
};


exports.register = function (server, options, next) {
	var results = Joi.validate(options, internals.schema);
	Hoek.assert(!results.error, results.error);
	var settings = results.value;

	Mongoose.connect(settings.uri, settings.options, function (err) {

		Hoek.assert(!err, err);

		var connection = Mongoose.connection;
		server.log('hapi-mongoose-connect', 'Database `' + connection.name + '` connected on ' + connection.host + ':' + connection.port);


		server.on('stop', function () {

			server.log('hapi-mongoose-connect', 'Database `' + connection.name + '` closed');
			connection.close();
		});

		next();
	});
};


{'fraction_non_alphanumeric': 0.18191108840061318, 'fraction_numerical': 0.0, 'mean_word_length': 3.9948979591836733, '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': '5121701', 'n_tokens_mistral': 701, 'n_tokens_neox': 637, 'n_words': 124}