Something went wrong. Try again.
VueTube is a YouTube clone built with nodejs, expressjs & mongodb. This is the RESTful API repository.
Something went wrong. Try again.
560 B · 26 lines
JavaScript
at master
123456789101112131415161718192021222324252627const mongoose = require('mongoose')
const Schema = mongoose.Schema
const FeelingSchema = new Schema( { type: { type: String, enum: ['like', 'dislike'], required: [true, 'Type is required either like or dislike'] }, videoId: { type: mongoose.Schema.ObjectId, ref: 'Video', required: [true, 'Video id is required'] }, userId: { type: mongoose.Schema.ObjectId, ref: 'User', required: true } }, { timestamps: true })
module.exports = mongoose.model('Feeling', FeelingSchema)