CSE316/final/server/models/top5list-model.js
2022-05-23 06:22:34 -04:00

20 lines
688 B
JavaScript

const mongoose = require('mongoose')
const Schema = mongoose.Schema
const Top5ListSchema = new Schema(
{
name: { type: String, required: true },
items: { type: [String], required: true },
owner: { type: String, require: true },
likes: { type: [String], require: true},
dislikes: { type: [String], require: true},
views: { type: Number, require: true},
comments: { type: [[String, String]], required: false},
published: { type: Boolean, required: true},
publishedAt: { type: [Number,Number,Number], require: false }
},
{ timestamps: true },
)
module.exports = mongoose.model('Top5List', Top5ListSchema)