{"size": 779, "ext": "js", "max_stars_repo_path": "back/projects/admin/mongodb/models/user.js", "max_stars_repo_name": "xunull/noadmin-koa", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "back/projects/admin/mongodb/models/user.js", "max_issues_repo_name": "xunull/noadmin-koa", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "back/projects/admin/mongodb/models/user.js", "max_forks_repo_name": "xunull/noadmin-koa", "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": 26.8620689655, "max_line_length": 52, "alphanum_fraction": 0.6277278562}
var mongoose = require('mongoose')
var Schema = mongoose.Schema
var _ = require('lodash')

var BasicProperty = require('./basic_property')

var UserSchema = new Schema(_.assign({
    name: { type: String },
    loginname: { type: String },
    passwd: { type: String },
    email: { type: String },
    url: { type: String },
    profile_image_url: { type: String },
    signature: { type: String },
    profile: { type: String },
    avatar: { type: String },
    is_block: { type: Boolean, default: false },

    level: { type: String },
    active: { type: Boolean, default: true },

    accessToken: { type: String }
}, BasicProperty))

UserSchema.index({ loginname: 1 }, { unique: true })
// UserSchema.index({email: 1}, {unique: true});

mongoose.model('User', UserSchema)
