Skip to content

Commit

Permalink
Add subscription model
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshchoudhary committed Dec 19, 2023
1 parent 4c3de94 commit 11bccd7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/models/subscription.model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import mongoose, {Schema} from "mongoose"

const subsciptionSchema = new Schema({
subscriber: {
type: Schema.Types.ObjectId, // one who is subscribing
ref: "User"
},
channel: {
type: Schema.Types.ObjectId, // one to whom 'subscriber' is subscribing
ref: "User"
}
}, {timestamps: true})



export const Subsciption = mongoose.model("Subsciption", subsciptionSchema)

0 comments on commit 11bccd7

Please sign in to comment.