module.exports = app=>{ const mongoose = app.mongoose; const Schema = mongoose.Schema; const User = new Schema({ name:{ type: String}, tel: { type: String}, isboy: {type: Boolean }, wechat:{ type: String}, address:{ type: String}, avatar:{ type: String}, birthday: {type: Date }, //被保人列表 family: [{ id:Schema.Types.ObjectId, avatar:String, name:String, tag:String, insured_orders:Number, //保单数量 total:Number, //总保额度 birthday: {type: Date }, career:{ type: String}, income: { type: Number }, //年收入 loan: { type: String }, }], password:String, create_time:Date, },{ collection:'users' }); //todo why 查询表admins; return mongoose.model("User", User); };