UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.66 kB
'use strict';const datlichSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},id_link:{type:String,maxlength:1024},collection_link:{type:String,maxlength:1024},datlich_user:{type:String,lowercase:!0,maxlength:1024},phone:{type:String,maxlength:1024},name:String,address:String,ma_kho:{type:String,maxlength:1024},ten_kho:String,ma_kh:{type:String,maxlength:1024},ten_kh:String,ngay:{type:Date,required:!0},khung_gio:{type:String,required:!0,maxlength:1024},nhac_nho_truoc:{type:Number,default:20}, thong_tin_san_pham:{type:String,maxlength:1024},group_id:{type:String},noi_dung:{type:String,required:!0},ghi_chu:{type:String},support_user:{type:String,lowercase:!0,maxlength:1024},phu_trach:{type:String,lowercase:!0,maxlength:1024},attends:[],trang_thai:{type:String,default:"HENLICH"},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&&(datlichSchema.index({id_app:1}),datlichSchema.index({datlich_user:1}),datlichSchema.index({ma_kho:1}),datlichSchema.index({ma_kh:1}),datlichSchema.index({id_link:1}),datlichSchema.index({phu_trach:1}),datlichSchema.index({group_id:1}),datlichSchema.index({status:1}),datlichSchema.index({user_created:1,visible_to:1,visible_to_users:1}),datlichSchema.index({trang_thai:1}),datlichSchema.index({attends:1}),datlichSchema.index({datlich_user:"text",phone:"text",ma_kh:"text", ten_kh:"text",ma_kho:"text",ten_kho:"text"},{name:"datlich_index_text"}));module.exports=mongoose.models.datlich||mongoose.model("datlich",datlichSchema);