Skip to content

Commit dbb428a

Browse files
committed
add timestamps
1 parent 72f1808 commit dbb428a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/models/userModel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ const userSchema = new mongoose.Schema({
4949
type: String,
5050
required: true,
5151
},
52+
createdAt: {
53+
type: Date,
54+
default: Date.now,
55+
},
56+
modifiedAt: {
57+
type: Date,
58+
default: Date.now,
59+
},
5260
});
5361

5462
// Hash password and security answer before saving

0 commit comments

Comments
 (0)