{"size": 588, "ext": "js", "max_stars_repo_path": "src/model/user.js", "max_stars_repo_name": "ramingar/keeping-tabs-on-taps-API", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/model/user.js", "max_issues_repo_name": "ramingar/keeping-tabs-on-taps-API", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/model/user.js", "max_forks_repo_name": "ramingar/keeping-tabs-on-taps-API", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.7777777778, "max_line_length": 67, "alphanum_fraction": 0.6139455782}
import mongoose from 'mongoose';
import {Schema} from 'mongoose';
import passportLocalMongoose from 'passport-local-mongoose';

const UserSchema = Schema({
    name: {
        type: String
    },
    email: {
        type: String
    },
    pass: {
        type: String
    },
    contractsCreditor: [{
        type: Schema.Types.ObjectId,
        ref: 'Contract'
    }],
    contractsDebtor: [{
        type: Schema.Types.ObjectId,
        ref: 'Contract'
    }]
});

UserSchema.plugin(passportLocalMongoose, {usernameField: 'email'});
export default mongoose.model('User', UserSchema);
