adding default/required attributes to the models
This commit is contained in:
1 parent
481f64f1fe
commit
734e158347
3 files changed
+21
-21
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user