flexbiz-server
Version:
Flexible Server
4 lines (3 loc) • 1.01 kB
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:""}}),model=mongoose.models.assreceiver||mongoose.model("assreceiver",assreceiverSchema);
(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"}),model.on("index",async function($err$$){$err$$?console.error("assreceiver index error",$err$$):console.info("assreceiver indexing complete")}));
module.exports=model;