This repository has been archived on 2022-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
brainlet/models/Category.js
2020-10-05 20:36:03 +03:00

10 lines
No EOL
267 B
JavaScript
Executable file

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;