flexbiz-server
Version:
Flexible Server
4 lines (3 loc) • 1.05 kB
JavaScript
;const phanloainhadatSchema=new Schema({id_app:{type:String,required:!0},stt:Number,ten_phan_loai:{type:String,required:!0,maxlength:1024},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:0},visible_to_users:[String],visible_to_usergroups:[String],dataview_to:{type:Number,default:0},dataview_to_users:[String],update_right:[String],
delete_right:[String]});(global.configs||{}).createIndexes&&(phanloainhadatSchema.index({ten_phan_loai:"text"},{name:"phanloainhadat_index"}),phanloainhadatSchema.index({status:1}),phanloainhadatSchema.index({date_created:1}),phanloainhadatSchema.index({date_updated:1}),phanloainhadatSchema.index({visible_to_usergroups:1}),phanloainhadatSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.phanloainhadat||mongoose.model("phanloainhadat",phanloainhadatSchema);
module.exports=model;