infoPriceClass.js 516 B

123456789101112131415
  1. const mongoose = require('mongoose');
  2. const Schema = mongoose.Schema;
  3. const collectionName = 'infoPriceClass';
  4. const modelSchema = {
  5. ID: { type: String, required: true, index: true },
  6. class: { type: Number, unique: true, index: true }, // 类别
  7. classCode: String, // 别名编码
  8. code: String, // 编码
  9. name: String, // 材料名称
  10. specs: String, // 规格型号
  11. unit: String, // 单位
  12. };
  13. mongoose.model(collectionName, new Schema(modelSchema, { versionKey: false, collection: collectionName }));