UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 727 B
'use strict';const fieldrightScheam=new Schema({ma_ct:{type:String,required:!0,uppercase:!0,maxlength:32},field_name:{type:String,required:!0,maxlength:1024},title:{type:String,required:!0,maxlength:1024},title_en:{type:String,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:""}}); (global.configs||{}).createIndexes&&(fieldrightScheam.index({email:1,id_app:1,module:1}),fieldrightScheam.index({status:1}),fieldrightScheam.index({user_created:1,visible_to:1,visible_to_users:1}));module.exports=mongoose.models.fieldright||mongoose.model("fieldright",fieldrightScheam);