123456789101112131415161718192021222324252627282930313233343536 |
- const mongoose = require('mongoose')
- const registermapSchema = new mongoose.Schema({
- name: {
- type: String,
- required: true },
- tag: String,
- description: String,
- meta: [mongoose.Schema.Types.Mixed]
- })
- module.exports = mongoose.model('Project', registermapSchema)
- const settingSchema = new mongoose.Schema({
- name: {
- type: String,
- required: true,
- maxlength: 50 },
- tag: {
- type: String,
- maxlength: 10,
- required: true },
- description: {
- type: String,
- maxlength: 200 },
- group: {
- type: String,
- maxlength: 20 },
- bits: {
- type: Number,
- min: 1,
- get: (value) => Math.round(value),
- set: (value) => Math.round(value) }
- })
- module.exports = mongoose.model('Setting', settingSchema)
|