This repository has been archived on 2025-12-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
chathive/server/models/Post.js
Andrew Trieu a25ea2d90a Post routes
2023-07-11 19:45:01 +03:00

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;