From 64f6c4121012e4e10d01568e847a6172562a2512 Mon Sep 17 00:00:00 2001 From: AriaYu927 Date: Tue, 31 Oct 2023 16:04:22 +0800 Subject: [PATCH] set default value for createdDatetime --- src/models/team.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/team.js b/src/models/team.js index 97f8dc360..00fbaf8e3 100644 --- a/src/models/team.js +++ b/src/models/team.js @@ -5,7 +5,7 @@ const { Schema } = mongoose; const team = new Schema({ teamName: { type: 'String', required: true }, isActive: { type: 'Boolean', required: true, default: true }, - createdDatetime: { type: Date }, + createdDatetime: { type: Date, default: Date.now() }, modifiedDatetime: { type: Date, default: Date.now() }, members: [ {