UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 662 B
'use strict';const tcSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},ma_tc:{type:String,required:!0,maxlength:32},ten_tc:{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:""}}); (global.configs||{}).createIndexes&&(tcSchema.index({id_app:1,ma_tc:1,ten_tc:1}),tcSchema.index({ma_tc:"text",ten_tc:"text"}),tcSchema.index({status:1}),tcSchema.index({user_created:1,visible_to:1,visible_to_users:1}));module.exports=mongoose.models.tc||mongoose.model("tc",tcSchema);