flexbiz-server
Version:
Flexible Server
3 lines (2 loc) • 858 B
JavaScript
const assreceiverSchema=new Schema({id_app:String,name:{type:String,maxlength:1024,required:!0},address:{type:String,required:!0,maxlength:2024,trim:!0},note:{type:String},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&&(assreceiverSchema.index({id_app:1}),assreceiverSchema.index({address:1}),assreceiverSchema.index({name:1}),assreceiverSchema.index({note:1}),assreceiverSchema.index({status:1}),assreceiverSchema.index({user_created:1}),assreceiverSchema.index({address:"text",name:"text",note:"text"},{name:"assreceiver_index2"}));const model=mongoose.models.assreceiver||mongoose.model("assreceiver",assreceiverSchema);module.exports=model;