user.js 984 B

1234567891011121314151617181920212223242526272829303132333435
  1. module.exports = app=>{
  2. const mongoose = app.mongoose;
  3. const Schema = mongoose.Schema;
  4. const User = new Schema({
  5. name:{ type: String},
  6. tel: { type: String},
  7. isboy: {type: Boolean },
  8. wechat:{ type: String},
  9. address:{ type: String},
  10. avatar:{ type: String},
  11. birthday: {type: Date },
  12. //被保人列表
  13. family: [{
  14. id:Schema.Types.ObjectId,
  15. avatar:String,
  16. name:String,
  17. tag:String,
  18. insured_orders:Number, //保单数量
  19. total:Number, //总保额度
  20. birthday: {type: Date },
  21. career:{ type: String},
  22. income: { type: Number }, //年收入
  23. loan: { type: String },
  24. }],
  25. password:String,
  26. create_time:Date,
  27. },{
  28. collection:'users'
  29. });
  30. //todo why 查询表admins;
  31. return mongoose.model("User", User);
  32. };