flexbiz-server
Version:
Flexible Server
5 lines (4 loc) • 1.42 kB
JavaScript
;const dmnckkmSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},stt:{type:Number,default:0},loai_cs:{type:String,default:"DMCHIETKHAU",enum:["DMCHIETKHAU","DMKHUYENMAI","DMCHIETKHAUHD","DMKHUYENMAIHD"]},ten_nhom:{type:String,required:!0,maxlength:1024},phuong_phap_ap_dung:{type:String,default:"STT_UU_TIEN",enum:["TOI_THIEU","TOI_DA","CONG","LOAI_TRU","STT_UU_TIEN"]},nh_me:{type:String,maxlength:1024},loai_nh:{type:Number,default:1},bac:Number,sysorder:String,description:String,
exfields:Schema.Types.Mixed,status:{type:Boolean,default:!0},shared:{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:""}},{toJSON:{virtuals:!0}});
(global.configs||{}).createIndexes&&(dmnckkmSchema.index({id_app:1,ten_nhom:1}),dmnckkmSchema.index({nh_me:1}),dmnckkmSchema.index({phuong_phap_ap_dung:1}),dmnckkmSchema.index({sysorder:1}),dmnckkmSchema.index({loai_nh:1}),dmnckkmSchema.index({group_kind:1}),dmnckkmSchema.index({bac:1}),dmnckkmSchema.index({description:1}),dmnckkmSchema.index({ten_nhom:"text",nh_me:"text",description:"text"},{name:"dmnckkm_index_text"}),dmnckkmSchema.index({status:1}),dmnckkmSchema.index({user_created:1,visible_to:1,
visible_to_users:1}));const model=mongoose.models.dmnckkm||mongoose.model("dmnckkm",dmnckkmSchema);module.exports=model;