12345678910111213141516171819202122 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 交底书表
- const cpcimporterror = {
- key: { type: String }, // 专利信息
- name: { type: String }, // 专利信息名称
- create_number: { type: String }, //专利号
- word: { type: String }, // 错误信息
- filepath: { type: String }, // 导入的zip包路径(绝对)
- time: { type: String }, // 时间
- };
- const schema = new Schema(cpcimporterror, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ key: 1 });
- schema.index({ time: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = (app) => {
- const { mongoose } = app;
- return mongoose.model('Cpcimporterror', schema, 'cpcimporterror');
- };
|