aboutsummaryrefslogtreecommitdiffstats
path: root/models/NoteList.js
blob: f07ea501c9c0872cf67657353c336d7108f40c53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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