UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.24 kB
const phucapSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},id_ct:String,thang:{type:Number},nam:{type:Number},ten_phu_cap:String,tien:{type:Number},ma_nt:{type:String,default:"VND"},ma_nv:String,ten_nv:String,ma_bp:String,ten_bp:String,kieu:{type:String,default:"1"},exfields:Schema.Types.Mixed,visible_to:{type:Number,default:0},visible_to_users:[String],update_right:[String],delete_right:[String],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:""}}); (global.configs||{}).createIndexes&&(phucapSchema.index({id_app:1,ma_bp:1,ma_nv:1,thang:1,nam:-1}),phucapSchema.index({id_app:1,ten_nv:1,ten_bp:1}),phucapSchema.index({id_app:1,ten_phu_cap:1}),phucapSchema.index({id_app:1,thang:-1,nam:-1}),phucapSchema.index({id_app:1,id_ct:1}),phucapSchema.index({id_app:1,ma_bp:"text",ten_bp:"text",ma_nv:"text",ten_nv:"text",ten_phu_cap:"text"},{name:"phucap_index_text2"}),phucapSchema.index({id_app:1,status:1}),phucapSchema.index({id_app:1,user_created:1,visible_to:1, visible_to_users:1}));const model=mongoose.models.phucap||mongoose.model("phucap",phucapSchema);module.exports=model;