From bae6d329c44701755c85fb64e9b885c907897a88 Mon Sep 17 00:00:00 2001 From: Mateja Date: Mon, 3 May 2021 18:53:54 +0200 Subject: Add `date` to `post` model. --- models/post.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/post.js b/models/post.js index 3f341d1..af53543 100644 --- a/models/post.js +++ b/models/post.js @@ -2,7 +2,8 @@ const mongoose = require('mongoose'); const postSchema = new mongoose.Schema({ title: String, - text: String + text: String, + date: {type: Date, default: Date.now} }); const postModel = mongoose.model('post', postSchema); -- cgit v1.2.3