'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 学生-团队分表 const GroupscoreSchema = { classid: { type: String, required: true, maxLength: 200 }, // 班级id subid: { type: String, required: true, maxLength: 500 }, // 科目id date: { type: String, required: false, maxLength: 200 }, // 该科上课日期 groupid: { type: String, required: true, maxLength: 200 }, // 小组id score: { type: String, required: true, maxLength: 200 }, // 分数 }; const schema = new Schema(GroupscoreSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('GroupscoreSchema', schema, 'groupscore'); };