aboutsummaryrefslogtreecommitdiffstats
path: root/models/NoteList.js
diff options
context:
space:
mode:
authorGravatar piotrruss <mail@pruss.it> 2021-08-09 21:36:03 +0200
committerGravatar piotrruss <mail@pruss.it> 2021-08-09 21:37:03 +0200
commit464e470441287572cfda8d95484f781236b9db35 (patch)
tree87177837cb6ee6ee000f0d39fa5ba7ee6bb2943e /models/NoteList.js
downloadmy_apps-464e470441287572cfda8d95484f781236b9db35.tar.gz
my_apps-464e470441287572cfda8d95484f781236b9db35.tar.bz2
my_apps-464e470441287572cfda8d95484f781236b9db35.zip
init commit
Diffstat (limited to 'models/NoteList.js')
-rw-r--r--models/NoteList.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/models/NoteList.js b/models/NoteList.js
new file mode 100644
index 0000000..f07ea50
--- /dev/null
+++ b/models/NoteList.js
@@ -0,0 +1,21 @@
+const mongoose = require("mongoose")
+
+const noteListSchema = new mongoose.Schema({
+ notes: [{
+ title: {
+ type: String,
+ required: true,
+ },
+ noteId: {
+ type: mongoose.Schema.Types.ObjectId,
+ ref: "Note",
+ required: true,
+ },
+ created_at: {type: Date, default: Date.now},
+ updated_at: {type: Date, default: Date.now}
+ }]
+})
+
+const NoteList = mongoose.models.NoteList || mongoose.model('NoteList', noteListSchema)
+
+export default NoteList