diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/post.js | 3 |
1 files changed, 2 insertions, 1 deletions
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); |