12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- /**
- * 用户数据结构
- *
- * @author CaiAoLin
- * @date 2017/6/28
- * @version
- */
- let mongoose = require("mongoose");
- let Schema = mongoose.Schema;
- // 表名
- let collectionName = 'user';
- // 表结构
- let schema = {
- username: String,
- email: String,
- mobile: String,
- real_name: {
- type: String,
- default: ''
- },
- company: {
- type: String,
- default: ''
- },
- province: {
- type: Number,
- default: -1
- },
- area: {
- type: Number,
- default: 0
- },
- company_type: {
- type: Number,
- default: -1,
- },
- company_scale: {
- type: Number,
- default: -1
- },
- create_time: Number
- };
- export default mongoose.model(collectionName, new Schema(schema, {versionKey: false}));
|