UNPKG

flexbiz-server

Version:

Flexible Server

4 lines (3 loc) 1.09 kB
'use strict';const introducecodeSchema=new Schema({id_app:{type:String,required:!0},introduce_code:{type:String,required:!0},expiry_date:Date,so_lan_su_dung:Number,wallet_address_receive_reward:String,trang_thai:{type:String,default:"0"},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:""},visible_to:{type:Number,default:0},visible_to_users:[String], update_right:[String],delete_right:[String],dataview_to:{type:Number,default:0},dataview_to_users:[String]});(global.configs||{}).createIndexes&&(introducecodeSchema.index({id_app:1}),introducecodeSchema.index({introduce_code:1}),introducecodeSchema.index({id_app:1,introduce_code:1},{unique:!0}),introducecodeSchema.index({status:1}),introducecodeSchema.index({user_created:1,visible_to:1,visible_to_users:1}),introducecodeSchema.index({trang_thai:1})); const model=mongoose.models.introducecode||mongoose.model("introducecode",introducecodeSchema);module.exports=model;