32 lines
609 B
JavaScript
32 lines
609 B
JavaScript
import mongoose from 'mongoose';
|
|
|
|
const PostSchema = new mongoose.Schema({
|
|
userId: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
firstName: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
lastName: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
location: String,
|
|
content: String,
|
|
profilePicturePath: String,
|
|
contentPicturePath: String,
|
|
likes : {
|
|
type: Map,
|
|
of: Boolean,
|
|
},
|
|
comments: {
|
|
type: Array,
|
|
default: [],
|
|
}
|
|
}, { timestamps: true });
|
|
|
|
const Post = mongoose.model('Post', PostSchema);
|
|
|
|
export default Post; |