12345678910111213141516171819 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const Answerapply = {
- teacher: { type: String, required: true, maxLength: 200 },
- teacherid: { type: String, required: true, maxLength: 200 },
- date: { type: [ String ], required: true },
- subid: { type: String, required: true, maxLength: 200 },
- status: { type: String, maxLength: 200, default: '0' },
- };
- const schema = new Schema(Answerapply, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Answerapply', schema, 'answerapply');
- };
|