diff options
Diffstat (limited to 'models/checklists.js')
-rw-r--r-- | models/checklists.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/models/checklists.js b/models/checklists.js index f139192e..7ad9cae5 100644 --- a/models/checklists.js +++ b/models/checklists.js @@ -35,6 +35,8 @@ Checklists.attachSchema( autoValue() { if (this.isInsert) { return new Date(); + } else if (this.isUpsert) { + return { $setOnInsert: new Date() }; } else { this.unset(); } |