UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.17 kB
'use strict';const nhomnhadatSchema=new Schema({id_app:{type:String,required:!0},stt:Number,ma_nhom:{type:String,required:!0,maxlength:1024},ten_nhom:{type:String,required:!0,maxlength:1024},public:Boolean,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&&(nhomnhadatSchema.index({id_app:1,ma_nhom:1}),nhomnhadatSchema.index({public:1}),nhomnhadatSchema.index({stt:1}),nhomnhadatSchema.index({ten_nhom:"text"},{ten_nhom:"nhomnhadat_index"}),nhomnhadatSchema.index({status:1}),nhomnhadatSchema.index({date_created:1}),nhomnhadatSchema.index({date_updated:1}),nhomnhadatSchema.index({visible_to_usergroups:1}),nhomnhadatSchema.index({user_created:1,visible_to:1,visible_to_users:1})); const model=mongoose.models.nhomnhadat||mongoose.model("nhomnhadat",nhomnhadatSchema);module.exports=model;