brainlet/models/Post.js
2020-10-05 20:36:03 +03:00

10 lines
No EOL
288 B
JavaScript
Executable file

const mongoose = require('mongoose');
const Post = mongoose.model('Post', {
title: String,
body: String,
creator: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
categoryId: {type: mongoose.Schema.Types.ObjectId, ref: 'Category'}
});
module.exports = Post;