aboutsummaryrefslogtreecommitdiffstats
path: root/models/Note.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/Note.js')
-rw-r--r--models/Note.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/Note.js b/models/Note.js
new file mode 100644
index 0000000..1790c91
--- /dev/null
+++ b/models/Note.js
@@ -0,0 +1,9 @@
+const mongoose = require('mongoose')
+
+const noteSchema = new mongoose.Schema({
+ content: {type: String, required: true, minlength: 1},
+});
+
+const Note = mongoose.models.Note || mongoose.model('Note', noteSchema)
+
+export default Note