flexbiz-server
Version:
Flexible Server
3 lines (2 loc) • 862 B
JavaScript
;const colleagueSchema=new Schema({email_owner:{type:String,required:!0,lowercase:!0},email:{type:String,required:!0,lowercase:!0},content:{type:String},active:{type:Boolean,default:!1},cancel:{type:Boolean,default:!1},status:{type:Boolean,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:""},latest_message:{type:String,default:""},latest_message_id:{type:String},latest_message_date:{type:Date}});
(global.configs||{}).createIndexes&&(colleagueSchema.index({email_owner:1,email:1}),colleagueSchema.index({content:"text",email:"text"}),colleagueSchema.index({status:1}),colleagueSchema.index({user_created:1,visible_to:1,visible_to_users:1}));module.exports=mongoose.models.colleague||mongoose.model("colleague",colleagueSchema);