1
0
rest-api-example/models/Post.js
2020-09-13 03:53:13 +03:00

18 lines
281 B
JavaScript

const mongoose = require("mongoose")
const post_scheme = mongoose.Schema({
title: {
type: String,
required: true
},
description: {
type: String,
required: true
},
date: {
type: Date,
default: Date.now
}
})
module.exports = mongoose.model("Posts", post_scheme)