UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 692 B
'use strict';const tinhthanhSchema=new Schema({ten_tinh_thanh:{type:String,required:!0,maxlength:1024,trim:!0},description:String,stt:{type:Number,default:0},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&&(tinhthanhSchema.index({ten_tinh_thanh:"text"}),tinhthanhSchema.index({ten_tinh_thanh:1}),tinhthanhSchema.index({status:1}),tinhthanhSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.tinhthanh||mongoose.model("tinhthanh",tinhthanhSchema);module.exports=model;