UNPKG

flexbiz-server

Version:

Flexible Server

4 lines (3 loc) 1.07 kB
'use strict';const phucapSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},thang:{type:Number},nam:{type:Number},ten_phu_cap:String,tien:{type:Number},ma_nv:String,ten_nv:String,ma_bp:String,ten_bp:String,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({ten_nv:1}),phucapSchema.index({ten_bp:1}),phucapSchema.index({ten_phu_cap:1}),phucapSchema.index({ma_bp:"text",ten_bp:"text",ma_nv:"text",ten_nv:"text",ten_phu_cap:"text"},{name:"phucap_index_text"}),phucapSchema.index({status:1}),phucapSchema.index({user_created:1,visible_to:1,visible_to_users:1})); const model=mongoose.models.phucap||mongoose.model("phucap",phucapSchema);module.exports=model;