From 3a24adb35ba919fa1e254cc106aa1d11b17936c2 Mon Sep 17 00:00:00 2001 From: Rafal <rg00578@surrey.ac.uk> Date: Mon, 12 Apr 2021 16:25:30 +0100 Subject: [PATCH] Created mongoose model for comments --- comments-service/models/Comment.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 comments-service/models/Comment.js diff --git a/comments-service/models/Comment.js b/comments-service/models/Comment.js new file mode 100644 index 0000000..fc6d224 --- /dev/null +++ b/comments-service/models/Comment.js @@ -0,0 +1,15 @@ +import mongoose from 'mongoose'; + +const commentSchema = mongoose.Schema({ + body: String, + creatorId: String, + postId: String, + createdAt: { + type: Date, + default: new Date() + } +}); + +const Comment = mongoose.model("Comment", commentSchema); + +export default Comment; \ No newline at end of file -- GitLab