/** * Created by Zhong on 2018/3/22. */ /*清单模板*/ const mongoose = require('mongoose'); const Schema = mongoose.Schema; // 标记字段 const flagsSchema = new Schema({ fieldName: String, flag: Number }); const BillsTemplateSchema = { // 树结构所需ID ID: Number, ParentID: Number, NextSiblingID: Number, // 编号 code: String, // 名称 name: String, // 单位 unit: String, // 标记 flags:{ type: [flagsSchema], default: [] }, // 所属计价ID valuationId: String, // 工程专业 engineering: Number, type:Number, //计算基数 calcBase: String, //费率ID feeRateID:Number }; mongoose.model('temp_bills', BillsTemplateSchema, 'temp_bills');