12345678910111213141516171819202122 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 科目表
- const TalentedSchema = {
- planid: { type: String, required: false }, // 计划id
- termid: { type: String, required: false }, // 期id
- batchid: { type: String, required: false }, // 批次id
- classid: { type: String, ref: 'Class' }, // 班级id
- studentid: { type: String, ref: 'Student' }, // 学生id
- files: { type: Array }, // 文件列表
- };
- const schema = new Schema(TalentedSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Talented', schema, 'talented');
- };
|