adding default/required attributes to the models

This commit is contained in:
Nikola Bjelo committed 2018-10-27 18:27:20 +02:00
1 parent 481f64f1fe
commit 734e158347
3 files changed
+21 -21

No files matched your search

+6 -6
View File
@@ -1,12 +1,12 @@
import mongoose, { Schema } from 'mongoose'
const plotterSchema = new Schema({
ownerId: String,
isTemplate: Boolean,
name: String,
host: String,
repo: String,
moduleName: String
ownerId: { type: String, required: true },
isTemplate: { type: Boolean, default: false },
name: { type: String, required: true },
host: { type: String, required: true },
repo: { type: String, required: true },
moduleName: { type: String, required: true }
})
const Plotter = mongoose.model('Plotter', plotterSchema)