|
há 5 anos atrás | |
---|---|---|
.. | ||
README.md | há 7 anos atrás | |
column.js | há 5 anos atrás | |
img.js | há 5 anos atrás | |
menu.js | há 5 anos atrás | |
modules.js | há 5 anos atrás | |
news.js | há 5 anos atrás | |
newslist.js | há 5 anos atrás | |
site.js | há 5 anos atrás |
'use strict';
const Schema = require('mongoose').Schema;
const SchemaDefine = {
code: { type: String, required: true, maxLength: 64 },
name: { type: String, required: true, maxLength: 128 },
order: Number,
};
const schema = new Schema(SchemaDefine);
schema.index({ code: 1 }, { unique: true });
module.exports = app => {
const { mongoose } = app;
return mongoose.model('CodeCategory', schema, 'naf_code_category');
};