<commit_before>var mongoose = require('mongoose');

var schema = mongoose.Schema({
    name: {
        type: String,
        required: true
    },
    type: {
        type: Number,
        required: true
    },
    created: {
        type: Date,
        required: false
    }
});

schema.pre('save', function(next) {
    this.created = new Date();
    next();
});

//roomSchema.index({ url: 1 }, { unique: true });
//roomSchema.index({ name: 1 }, { unique: true });

/* Disable auto indexing. */
// roomSchema.set('autoIndex', false);

/**
 * Module exports.
 */

module.exports = mongoose.model('Category', schema, 'rooms');<commit_msg>modify `Category Schema`<commit_after>var mongoose = require('mongoose');

var schema = mongoose.Schema({
    name: {
        type: String,
        unique: true,
        required: true
    },
    type: {
        type: Number,
        unique: true,
        required: true
    },
    created: {
        type: Date,
        required: false
    }
});

schema.pre('save', function(next) {
    this.created = new Date();
    next();
});

/**
 * Module exports.
 */

module.exports = mongoose.model('Category', schema, 'rooms');
{'fraction_non_alphanumeric': 0.16753022452504318, 'fraction_numerical': 0.0017271157167530224, 'mean_word_length': 2.3594202898550725, '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': '5130099', 'n_tokens_mistral': 359, 'n_tokens_neox': 363, 'n_words': 86}