Skip to content

Commit

Permalink
(feat) created comment schema
Browse files Browse the repository at this point in the history
  • Loading branch information
danmolitor committed Dec 19, 2016
1 parent ce4ab51 commit 821b319
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;

const CommentSchema = new Schema({
content: String,
user: { type: ObjectId, ref: 'user' }
});

const Comment = mongoose.model('comment', CommentSchema);

module.exports = Comment;

0 comments on commit 821b319

Please sign in to comment.