UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 880 B
'use strict';const templaterptSchema=new Schema({_id_o:{type:String,maxlength:1024},id_app:{type:String,required:!0,maxlength:1024},ma_cn:{type:String,required:!0,uppercase:!0,maxlength:32,trim:!0},ten_mau_in:{type:String,required:!0,maxlength:1024},html_code:{type:String,trim:!0},exfields:Schema.Types.Mixed,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&&(templaterptSchema.index({id_app:1,ma_cn:1,ten_mau_in:1}),templaterptSchema.index({ma_cn:"text",ten_mau_in:"text"}),templaterptSchema.index({status:1}),templaterptSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.templaterpt||mongoose.model("templaterpt",templaterptSchema);module.exports=model;