<commit_before>let bcrypt = global.variables.bcrypt,
    mongoose = global.variables.mongoose,
    Schema = mongoose.Schema,
    salt_round = 10;

let User = new Schema({
    _id: {
        type: Schema.Types.ObjectId,
        default: () => {
            return mongoose.Types.ObjectId();
        }
    },
    email: {
        type: Schema.Types.String,
        required: true,
        unique: true
    },
    password: {
        type: Schema.Types.String,
        required: true
    },
    name: {
        type: Schema.Types.String,
        required: true
    },
    cards: [],
    notes: []
});

User.pre("save", function(next) {
    var user = this;

    if (!user.isModified("password")) {
        return next();
    }

    bcrypt.genSalt(salt_round, (err, salt) => {
        if (err) return next(err);

        bcrypt.hash(user.password, salt, (e, hash) => {
            if (e) return next(e);
<commit_msg>Update schema<commit_after>let bcrypt = global.variables.bcrypt,
    mongoose = global.variables.mongoose,
    Schema = mongoose.Schema,
    salt_round = 10;

let User = new Schema({
    _id: {
        type: Schema.Types.ObjectId,
        default: () => {
            return mongoose.Types.ObjectId();
        }
    },
    email: {
        type: Schema.Types.String,
        required: true,
        unique: true
    },
    password: {
        type: Schema.Types.String,
        required: true
    },
    name: {
        type: Schema.Types.String,
        required: true
    },
    cards: []
});

User.pre("save", function(next) {
    var user = this;

    if (!user.isModified("password")) {
        return next();
    }

    bcrypt.genSalt(salt_round, (err, salt) => {
        if (err) return next(err);

        bcrypt.hash(user.password, salt, (e, hash) => {
            if (e) return next(e);

{'fraction_non_alphanumeric': 0.14262023217247097, 'fraction_numerical': 0.002211166390270868, 'mean_word_length': 1.9288025889967637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3991786', 'n_tokens_mistral': 583, 'n_tokens_neox': 576, 'n_words': 124}