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.
449 B · 21 lines
JavaScript
at master
12345678910111213141516171819202122const mongoose = require('mongoose')
const Schema = mongoose.Schema
const SubscriptionSchema = new Schema( { subscriberId: { type: mongoose.Schema.ObjectId, ref: 'User', required: [true, 'Subscriber id is required'] }, channelId: { type: mongoose.Schema.ObjectId, ref: 'User', required: true } }, { timestamps: true })
module.exports = mongoose.model('Subscription', SubscriptionSchema)