UNPKG

flexbiz-server

Version:

Flexible Server

4 lines (3 loc) 1.09 kB
const ecomcategoriesScheam=new Schema({id_app:{type:String,required:!0,maxlength:1024},status:{type:Boolean,default:!0},ma_danh_muc:String,ten_danh_muc:String,ma_nganh_hang:String,danh_muc_me:String,sysorder:String,bac:{type:Number},loai_nh:{type:Number,default:1},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&&(ecomcategoriesScheam.index({id_app:1}),ecomcategoriesScheam.index({id_app:1,status:1}),ecomcategoriesScheam.index({id_app:1,ma_danh_muc:1}),ecomcategoriesScheam.index({id_app:1,ten_danh_muc:1}),ecomcategoriesScheam.index({id_app:1,ma_nganh_hang:1}),ecomcategoriesScheam.index({id_app:1,danh_muc_me:1}),ecomcategoriesScheam.index({id_app:1,sysorder:1}),ecomcategoriesScheam.index({id_app:1,bac:1}),ecomcategoriesScheam.index({id_app:1,loai_nh:1}),ecomcategoriesScheam.index({user_created:1, visible_to:1,visible_to_users:1}));module.exports=mongoose.models.ecomcategories||mongoose.model("ecomcategories",ecomcategoriesScheam);