UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.54 kB
'use strict';const profileSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},name:{type:String,required:!0,maxlength:1024},gioi_tinh:{type:String,maxlength:1024},ngay_sinh:Date,weight:Number,height:Number,dia_chi:{type:String,maxlength:1024},so_nha:{type:String,maxlength:1024},location:global.customTypes.Point,dien_thoai:{type:String,maxlength:1024},benh:{type:String,maxlength:1024},tinh_thanh_minh_man:Boolean,van_dong_can_ho_tro:Boolean,tam_can_ho_tro:Boolean,dai_tieu_tien_can_ho_tro:Boolean, thay_mac_quan_ao_can_ho_tro:Boolean,so_thich:{type:String,maxlength:1024},suc_khoe:{type:String,maxlength:1024},picture:{type:String,maxlength:1024},ghi_chu:{type:String,default:""},exfields:Schema.Types.Mixed,status:{type:Boolean,default:!0},date_created:{type:Date,default:Date.now},date_updated:{type:Date,default:Date.now},user_created:{type:String,default:""},user_updated:{type:String,default:""},visible_to:{type:Number,default:2},visible_to_users:[String],update_right:[String],delete_right:[String]}); (global.configs||{}).createIndexes&&(profileSchema.index({id_app:1}),profileSchema.index({name:1}),profileSchema.index({user_created:1}),profileSchema.index({date_created:-1}),profileSchema.index({date_updated:-1}),profileSchema.index({name:"text"}),profileSchema.index({status:1}),profileSchema.index({user_created:1,visible_to:1,visible_to_users:1}),profileSchema.index({location:"2dsphere"},{background:!1}));const model=mongoose.models.profile||mongoose.model("profile",profileSchema); module.exports=model;