aboutsummaryrefslogblamecommitdiff
path: root/models/post.js
blob: 8227c85b1b85ae2a9c1db08407f2067a130132ce (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11


                                        

                                        
                                       




                                                     
const mongoose = require('mongoose');

const postSchema = new mongoose.Schema({
  title: {type: String, required: true},
  text: {type: String, required: true},
  date: {type: Date, default: Date.now}
});

const postModel = mongoose.model('post', postSchema);

module.exports = postModel;