'use strict'; const Schema = require('mongoose').Schema; const SchemaDefine = { code: { type: String, required: true }, name: { type: String, required: true }, value: { type: String, required: true }, type: { type: String, required: false }, }; const schema = new Schema(SchemaDefine); module.exports = app => { const { mongoose } = app; return mongoose.model('toconfig', schema, 'toconfig'); };