postMessage.js 377 B

123456789101112131415161718192021
  1. import mongoose from "mongoose";
  2. const postSchema = mongoose.Schema({
  3. title: String,
  4. message: String,
  5. name: String,
  6. creator: String,
  7. selectedFile: String,
  8. likes: {
  9. type: [String],
  10. default: [],
  11. },
  12. createdAt: {
  13. type: Date,
  14. default: new Date(),
  15. },
  16. });
  17. const PostMessage = mongoose.model("postmessage", postSchema);
  18. export default PostMessage;