UNPKG

flexbiz-server

Version:

Flexible Server

4 lines (3 loc) 1.05 kB
'use strict';const mailgroupSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},group_name:{type:String,required:!0},nh_khs:[String],ma_khs:[String],ma_bps:[String],ma_hds:[String],ma_dts:[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&&(mailgroupSchema.index({id_app:1,group_name:"text"}),mailgroupSchema.index({group_name:1}),mailgroupSchema.index({nh_khs:1}),mailgroupSchema.index({ma_khs:1}),mailgroupSchema.index({ma_bps:1}),mailgroupSchema.index({ma_hds:1}),mailgroupSchema.index({ma_dts:1}),mailgroupSchema.index({status:1}),mailgroupSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.mailgroup||mongoose.model("mailgroup",mailgroupSchema); module.exports=model;