10 lines
267 B
JavaScript
10 lines
267 B
JavaScript
|
const mongoose = require('mongoose');
|
||
|
const Post = require('./Post');
|
||
|
|
||
|
const Category = mongoose.model('Category', {
|
||
|
title: String,
|
||
|
creator: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
|
||
|
posts: [Post.schema]
|
||
|
});
|
||
|
|
||
|
module.exports = Category;
|