Files
modstagram-back/models/PostSendModel.js
payacom 3f416a7a60 full
2026-08-31 20:45:41 +03:30

29 lines
610 B
JavaScript

const mongoose = require('mongoose')
const timestamp = require('mongoose-timestamp')
const postSendSchema = new mongoose.Schema({
postId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Post',
required: true,
index: true,
},
senderId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
index: true,
},
receiverId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
index: true,
},
})
postSendSchema.plugin(timestamp)
const PostSendModel = mongoose.model('PostSend', postSendSchema)
module.exports = PostSendModel