std_billsGuidance_material.js 573 B

123456789101112131415161718192021
  1. //清单指引材料数据
  2. const mongoose = require('mongoose');
  3. const Schema = mongoose.Schema;
  4. const materialSchema = {
  5. gljID: { type: Number, required: true }
  6. };
  7. const stdBillsGuidanceMaterial = new Schema({
  8. libID: String,
  9. ID: { type: String, index: true },
  10. billID: String, //关联清单的ID
  11. materials: {
  12. type: [materialSchema],
  13. default: [],
  14. },
  15. }, {versionKey: false});
  16. stdBillsGuidanceMaterial.index({ libID: 1, billID: 1 });
  17. mongoose.model('std_billsGuidance_materials', stdBillsGuidanceMaterial, 'std_billsGuidance_materials');