UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 788 B
const flowScheam=new Schema({id_app:{type:String,required:!0,maxlength:1024},title:String,nodes:[],edges:[],activeInstance: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&&(flowScheam.index({id_app:1}),flowScheam.index({id_app:1,title:1}),flowScheam.index({id_app:1,status:1}),flowScheam.index({id_app:1,"activeInstance.instanceId":1}),flowScheam.index({"activeInstance.status":1}),flowScheam.index({id_app:1,"activeInstance.status":1}),flowScheam.index({id_app:1,user_created:1,visible_to:1,visible_to_users:1}));module.exports=mongoose.models.flow||mongoose.model("flow",flowScheam);