full
This commit is contained in:
28
models/PostSendModel.js
Normal file
28
models/PostSendModel.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
Reference in New Issue
Block a user