UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 887 B
'use strict';const xaphuongSchema=new Schema({ten_tinh_thanh:{type:String,required:!0,maxlength:1024,trim:!0},ten_quan_huyen:{type:String,required:!0,maxlength:1024,trim:!0},ten_xa_phuong:{type:String,required:!0,maxlength:1024,trim:!0},description:String,stt:{type:Number,default:0},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&&(xaphuongSchema.index({ten_tinh_thanh:1,ten_quan_huyen:1,ten_xa_phuong:1}),xaphuongSchema.index({ten_tinh_thanh:"text",ten_quan_huyen:"text",ten_xa_phuong:"text"}),xaphuongSchema.index({status:1}),xaphuongSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.xaphuong||mongoose.model("xaphuong",xaphuongSchema);module.exports=model;