123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /**
- * 用户数据模型
- *
- * @author CaiAoLin
- * @date 2017/7/20
- * @version
- */
- import mongoose from "mongoose";
- let Schema = mongoose.Schema;
- let collectionName = 'users';
- let modelSchema = {
- // 用户名
- username: String,
- // 电子邮件
- email: String,
- // 手机号码
- mobile: String,
- // 真实姓名
- real_name: String,
- // 公司
- company: String,
- // 省份
- province: Number,
- // 公司类型
- company_type: {
- type: Number,
- default: -1
- },
- // 公司规模
- company_scale: {
- type: Number,
- default: -1
- },
- // 最后登录时间
- last_login: {
- type: Number,
- default: 0
- },
- // 创建时间
- create_time: {
- type: Number,
- default: 0
- },
- };
- mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));
|