12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /**
- * 用户数据模型
- *
- * @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
- },
- };
- let model = mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));
- export {model as default, collectionName as collectionName};
|